Documentation ¶
Overview ¶
Package storage stores the input axes in order, and can get a Plane by time interval.
Index ¶
- func ClearTableAxisModel(db *dbstore.DB) error
- func CreateStorageAxis(regions region.RegionsInfo, strategy matrix.Strategy) matrix.Axis
- func CreateTableAxisModelIfNotExists(db *dbstore.DB) (bool, error)
- func DeleteAxisModelsByLayerNum(db *dbstore.DB, layerNum uint8) error
- func IntoResponseAxis(storageAxis matrix.Axis, baseTag region.StatTag) matrix.Axis
- func IntoStorageAxis(responseAxis matrix.Axis, strategy matrix.Strategy) matrix.Axis
- type AxisModel
- type LayerConfig
- type Stat
- type StatConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearTableAxisModel ¶
func CreateStorageAxis ¶
CreateStorageAxis converts the RegionsInfo to a StorageAxis.
func CreateTableAxisModelIfNotExists ¶
If the table `AxisModel` exists, return true, nil or create table `AxisModel`
func IntoResponseAxis ¶
IntoResponseAxis converts StorageAxis to ResponseAxis.
Types ¶
type AxisModel ¶
type AxisModel struct { LayerNum uint8 `gorm:"unique_index:index_layer_time"` Time time.Time `gorm:"unique_index:index_layer_time"` Axis []byte }
func NewAxisModel ¶
type LayerConfig ¶
LayerConfig is the configuration of layerStat.
type Stat ¶
type Stat struct {
// contains filtered or unexported fields
}
Stat is composed of multiple layerStats.
func NewStat ¶
func NewStat(lc fx.Lifecycle, wg *sync.WaitGroup, db *dbstore.DB, cfg StatConfig, strategy matrix.Strategy, startTime time.Time) *Stat
NewStat generates a Stat based on the configuration.
func (*Stat) Append ¶
func (s *Stat) Append(regions region.RegionsInfo, endTime time.Time)
Append adds the latest full statistics.
type StatConfig ¶
type StatConfig struct {
LayersConfig []LayerConfig
}
StatConfig is the configuration of Stat.
Click to show internal directories.
Click to hide internal directories.