Documentation ¶
Index ¶
Constants ¶
const ( // StatDurationMin focus 1 minute StatDurationMin statDuration = iota // StatDuration10Min focus 10 minutes StatDuration10Min // StatDurationHour focus 1 hour StatDurationHour )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wrapped *spanner.Client for easy to use stats collect
type LockStat ¶ added in v0.1.1
type LockStat struct { IntervalEnd time.Time `spanner:"INTERVAL_END"` RowRangeStartKey []byte `spanner:"ROW_RANGE_START_KEY"` LockWaitSeconds float64 `spanner:"LOCK_WAIT_SECONDS"` SampleLockRequests []struct { LockMode string `spanner:"lock_mode"` Column string `spanner:"column"` } `spanner:"SAMPLE_LOCK_REQUESTS"` }
LockStat track the lock columns during a specific time period followed https://cloud.google.com/spanner/docs/introspection/lock-statistics
type QueryStat ¶ added in v0.1.1
type QueryStat struct { IntervalEnd time.Time `spanner:"INTERVAL_END"` Text string `spanner:"TEXT"` TextTruncated bool `spanner:"TEXT_TRUNCATED"` TextFingerprint int64 `spanner:"TEXT_FINGERPRINT"` ExecutionCount int64 `spanner:"EXECUTION_COUNT"` AvgLatencySeconds float64 `spanner:"AVG_LATENCY_SECONDS"` AvgRows float64 `spanner:"AVG_ROWS"` AvgBytes float64 `spanner:"AVG_BYTES"` AvgRowsScanned float64 `spanner:"AVG_ROWS_SCANNED"` AvgCPUSeconds float64 `spanner:"AVG_CPU_SECONDS"` }
QueryStat track the queries with the highest CPU usage during a specific time period followed https://cloud.google.com/spanner/docs/query-stats-tables
type TransactionStat ¶ added in v0.1.1
type TransactionStat struct { IntervalEnd time.Time `spanner:"INTERVAL_END"` Fprint int64 `spanner:"FPRINT"` ReadColumns []string `spanner:"READ_COLUMNS"` WriteConstructiveColumns []string `spanner:"WRITE_CONSTRUCTIVE_COLUMNS"` WriteDeleteTables []string `spanner:"WRITE_DELETE_TABLES"` CommitAttemptCount int64 `spanner:"COMMIT_ATTEMPT_COUNT"` CommitFailedPreconditionCount int64 `spanner:"COMMIT_FAILED_PRECONDITION_COUNT"` CommitAbortCount int64 `spanner:"COMMIT_ABORT_COUNT"` AvgParticipants float64 `spanner:"AVG_PARTICIPANTS"` AvgTotalLatencySeconds float64 `spanner:"AVG_TOTAL_LATENCY_SECONDS"` AvgCommitLatencySeconds float64 `spanner:"AVG_COMMIT_LATENCY_SECONDS"` AvgBytes float64 `spanner:"AVG_BYTES"` }
TransactionStat track the transactions during a specific time period followed https://cloud.google.com/spanner/docs/introspection/transaction-statistics
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker of stats collector
type Writer ¶
type Writer interface {
// Write stats collection to anything
Write([]stat)
}
Writer for stats collection
func NewOpenTelemetryWriter ¶ added in v0.1.1
func NewOpenTelemetryWriter() Writer
NewOpenTelemetryWriter return new Writer of OpenTelemetry
func NewZapWriter ¶
NewZapWriter return new Writer of *zap.Logger