BaseConfigamhist.BaseConfig Called is a list of mutation states (called ones) required to track a
transition. See also CalledExclude. Optional. CalledExclude flips Called to be a blocklist. Changed is a list of transition states which had clock changes, required to
track a transition. See also ChangedExclude. A state can be called, but not
changed. Optional. ChangedExclude flips Changed to be a blocklist.BaseConfig.Logbool MaxRecords is the maximum number of records to keep in the history before
a rotation begins. TODO StoreSchema keeps the latest machine schema and state names within
[MachineRecord]. Useful for dynamic machines. StoreTransitions is a flag to store TransitionRecord, in addition to
TimeRecord, for each tracked transition. TrackRejected is a flag to track rejected transitions. TrackedStates is a list of states to store clock values of. amount of records to save in bulk (default: 1000) amount of goroutines doing bulk saving (default: 10)
func NewMemory(ctx context.Context, db *gorm.DB, mach am.Api, cfg Config, onErr func(err error)) (*Memory, error)
Machine is a SQL version of [amhist.MachineRecord]. first time the machine has been trackedIDuint32 last time a sync has been performed last time a tracking of this machine has started current (total) machine time
TODO optimize: collect in a separate query sum of the current machine timeMachIdstring current machine start tick next ID for time recordsSchemadatatypes.JSONStateNamesdatatypes.JSONStates[]StateTimes[]Time
func GetMachine(db *gorm.DB, id string, inclStates bool) (*Machine, error)
Time is a SQL version of [amhist.TimeRecord]. HTime is a human time in UTC.IDuint64 MTimeDiffSum is a machine time difference for this transition. MTimeRecordDiffSum is a machine time difference since the previous
[amhist.TimeRecord]. MTimeSum is a machine time sum after this transition. MTime is a machine time for tracked states after this mutation. MTimeTrackedDiff is a machine time diff compared to the previous mutation
(not a record). TODO make optional? can be generated MTimeDiffSum is a machine time difference for this transition for tracked
states only. MTimeSum is a machine time sum after this transition for tracked states
only. TODO MTimeTrackedDiffCompact arpc-like clock encoding
MachTick is the machine tick at the time of this transition.MachineIDuint32 MutType is a mutation type.Ticks[]TickTxArguments*datatypes.JSONTxCalleddatatypes.JSONTxExecutedAt*uint64TxIdstringTxIsAcceptedboolTxIsAutoboolTxIsBrokenboolTxIsCheckboolTxQueueLenuint16TxQueuedAt*uint64TxSourceMach*stringTxSourceTx*string
Package-Level Functions (total 4)
GetMachine returns a machine record for a given machine id.
ListMachines returns a list of all machines in a database. TODO
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.