26 lines
838 B
Go
26 lines
838 B
Go
|
package lib
|
||
|
|
||
|
import "time"
|
||
|
|
||
|
// DataPoint represents a single metrics measurement containing performance statistics
|
||
|
// and counters for database and cache operations.
|
||
|
type DataPoint struct {
|
||
|
SessionID string `json:"session_id"`
|
||
|
Timestamp int64 `json:"timestamp"`
|
||
|
ServiceTime float64 `json:"service_time"`
|
||
|
DBTime float64 `json:"db_time"`
|
||
|
CacheTime float64 `json:"cache_time"`
|
||
|
DBRowsRead int64 `json:"db_rows_read"`
|
||
|
DBRowsWritten int64 `json:"db_rows_written"`
|
||
|
DBTotalRows int64 `json:"db_total_rows"`
|
||
|
CacheHits int64 `json:"cache_hits"`
|
||
|
CacheMisses int64 `json:"cache_misses"`
|
||
|
}
|
||
|
|
||
|
// TestData represents a test record used for performance measurements.
|
||
|
type TestData struct {
|
||
|
ID int64 `json:"id"`
|
||
|
Data string `json:"data"`
|
||
|
Timestamp time.Time `json:"timestamp"`
|
||
|
}
|