Documentation
¶
Overview ¶
Package builtin captures data from a robot's components, persists the captured data to disk and sync it to the cloud when possible.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCaptureDirectoryConfigurationDisabled happens when the viam-server is run with // `-untrusted-env` and the capture directory is not `~/.viam/capture`. ErrCaptureDirectoryConfigurationDisabled = errors.New("changing the capture directory is prohibited in this environment") )
Functions ¶
func New ¶ added in v0.44.0
func New( ctx context.Context, deps resource.Dependencies, conf resource.Config, cloudClientConstructor func(grpc.ClientConnInterface) v1.DataSyncServiceClient, logger logging.Logger, ) (datamanager.Service, error)
New returns a new builtin data manager service for the given robot.
Types ¶
type CaptureControlSensorConfig ¶ added in v0.116.0
type CaptureControlSensorConfig struct {
// Name is the resource name of the sensor.
Name string `json:"name"`
// Key is the key in the sensor's Readings map that contains the controls array, a list
// of `CaptureConfigReading` values.
Key string `json:"key"`
}
CaptureControlSensorConfig describes a sensor that provides dynamic capture controls.
type Config ¶
type Config struct {
// Sync & Capture
CaptureDir string `json:"capture_dir"`
Tags []string `json:"tags"`
// Capture
CaptureDisabled bool `json:"capture_disabled"`
MongoCaptureConfig *capture.MongoConfig `json:"mongo_capture_config"`
// File Deletion Parameters
DeleteEveryNthWhenDiskFull int `json:"delete_every_nth_when_disk_full"`
MaximumCaptureFileSizeBytes int64 `json:"maximum_capture_file_size_bytes"`
DiskUsageDeletionThreshold float64 `json:"disk_usage_deletion_threshold"`
CaptureDirDeletionThreshold float64 `json:"capture_dir_deletion_threshold"`
// Sync
AdditionalSyncPaths []string `json:"additional_sync_paths"`
FileLastModifiedMillis int `json:"file_last_modified_millis"`
MaximumNumSyncThreads int `json:"maximum_num_sync_threads"`
ScheduledSyncDisabled bool `json:"sync_disabled"`
SelectiveSyncerName string `json:"selective_syncer_name"`
SyncIntervalMins float64 `json:"sync_interval_mins"`
// CaptureControlSensor when set specifies a sensor to poll for dynamic
// capture configurations.
CaptureControlSensor *CaptureControlSensorConfig `json:"capture_control_sensor,omitempty"`
}
Config describes how to configure the service. See sync.Config and capture.Config for docs on what each field does to both sync & capture respectively.
type DataTimeRange ¶ added in v0.44.0
DataTimeRange represents a time range from Start to End.
type DirSummary ¶ added in v0.44.0
type DirSummary struct {
Path string
FileSize int64
FileCount int64
Err error
// DataTimeRange is the time range across all files in the directory. Capture files
// (.capture/.prog) use the timestamp encoded in their name; arbitrary files use their
// filesystem creation time.
DataTimeRange *DataTimeRange
// SyncableFileTimeRange is the time range of files that are complete and waiting to
// sync: completed capture (.capture) files and arbitrary files. In-progress (.prog)
// capture files are excluded since they are still being written. Nil when
// ExcludedFromSync is set.
SyncableFileTimeRange *DataTimeRange
// ExcludedFromSync is set for directories sync never uploads from: any failed/ or
// datasetUpload/ directory below the root, and everything beneath it.
ExcludedFromSync bool
}
DirSummary represents a summary of the files in that directory including file counts, total size of files in that directory and the time range of the data in that directory. File and directory errors are accumulated on Err.
func DiskSummary ¶ added in v0.44.0
func DiskSummary(ctx context.Context, rootPath string) []DirSummary
DiskSummary summarizes the provided sync path and all sub directories. The rootPath can either be the viam capture dir which data capture collectors write to or an additional sync path that contains arbitrary files. It will return a slice of DirSummary structs. Directories with no filesare ignored.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package capture implements datacapture for the builtin datamanger
|
Package capture implements datacapture for the builtin datamanger |
|
package main prints a disk summary of the builtin data manager's capture directory or additional sync paths It exists purely as a convenience utilty for viam developers & solutions engineers.
|
package main prints a disk summary of the builtin data manager's capture directory or additional sync paths It exists purely as a convenience utilty for viam developers & solutions engineers. |
|
Package shared is for any variables/functions shared amongst the datamanager builtin package and its subpackages.
|
Package shared is for any variables/functions shared amongst the datamanager builtin package and its subpackages. |
|
Package sync implements datasync for the builtin datamanger
|
Package sync implements datasync for the builtin datamanger |