{"modulePath":"github.com/infinitbyte/framework","version":"v1.1.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package stats\n\n## Constants\n\n```go\nconst Decr = \"decr\"\n```\n\n```go\nconst Incr = \"incr\"\n```\n\n## Types\n\n```go\ntype SimpleStatsConfig struct {\n\tEnabled                  bool `config:\"enabled\"`\n\tPersist                  bool `config:\"persist\"`\n\tNoBuffer                 bool `config:\"no_buffer\"`\n\tIncludeStorageStatsInAPI bool `config:\"include_storage_stats_in_api\"`\n\tBufferSize               int  `config:\"buffer_size\"`\n\tFlushIntervalInMs        int  `config:\"flush_interval_ms\"`\n}\n```\n\n```go\ntype SimpleStatsModule struct {\n\tapi.Handler\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (handler SimpleStatsModule) BufferItemStatsAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params)\n```\n\n```go\nfunc (handler SimpleStatsModule) DeleteDataFile(w http.ResponseWriter, req *http.Request, ps httprouter.Params)\n```\n\n```go\nfunc (handler SimpleStatsModule) GoroutinesAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params)\n```\n\n```go\nfunc (handler SimpleStatsModule) ListDirFs(w http.ResponseWriter, req *http.Request, ps httprouter.Params)\n```\n\n```go\nfunc (module SimpleStatsModule) Name() string\n```\n\n```go\nfunc (handler SimpleStatsModule) PrometheusStatsAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params)\n```\nStatsAction return stats information\n\n```go\nfunc (module *SimpleStatsModule) Setup()\n```\n\n```go\nfunc (module *SimpleStatsModule) Start() error\n```\n\n```go\nfunc (handler SimpleStatsModule) StatsAction(w http.ResponseWriter, req *http.Request, ps httprouter.Params)\n```\nStatsAction return stats information\n\n```go\nfunc (module *SimpleStatsModule) Stop() error\n```\n\n```go\ntype StatItem struct {\n\tOp       string\n\tCategory string\n\tKey      string\n\tValue    int64\n}\n```\n\n```go\ntype Stats struct {\n\tID   string                       `storm:\"id,unique\" json:\"id\" gorm:\"not null;unique;primary_key\"`\n\tData *map[string]map[string]int64 `storm:\"inline\" json:\"data,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *Stats) Absolute(category, key string, value int64)\n```\n\n```go\nfunc (s *Stats) Decrement(category, key string)\n```\n\n```go\nfunc (s *Stats) DecrementBy(category, key string, value int64)\n```\n\n```go\nfunc (s *Stats) Gauge(category, key string, v int64)\n```\n\n```go\nfunc (s *Stats) GetTimestamp(category, key string) (time.Time, error)\n```\n\n```go\nfunc (s *Stats) Increment(category, key string)\n```\n\n```go\nfunc (s *Stats) IncrementBy(category, key string, value int64)\n```\n\n```go\nfunc (s *Stats) RecordTimestamp(category, key string, v time.Time)\n```\n\n```go\nfunc (s *Stats) Stat(category, key string) int64\n```\n\n```go\nfunc (s *Stats) StatsAll() string\n```\n\n```go\nfunc (s *Stats) Timing(category, key string, v int64)\n```\n\n","path":"github.com/infinitbyte/framework/modules/stats","name":"stats","synopsis":"","isRedistributable":true}
