Files
crawlab/core/models/models/task_stat.go
Marvin Zhang 4f57d277e7 refactor: standardize timestamp fields and improve code clarity
- Updated timestamp fields across the codebase from `*_ts` to `*_at` for consistency and clarity.
- Renamed constants for node status from "on"/"off" to "online"/"offline" to better reflect their meanings.
- Enhanced validation and error handling in various components to ensure data integrity.
- Refactored test cases to align with the new naming conventions and improve readability.
2025-04-21 18:13:22 +08:00

17 lines
818 B
Go

package models
import (
"time"
)
type TaskStat struct {
any `collection:"task_stats"`
BaseModel `bson:",inline"`
StartedAt time.Time `json:"started_at" bson:"started_at,omitempty" description:"Start time"`
EndedAt time.Time `json:"ended_at" bson:"ended_at,omitempty" description:"End time"`
WaitDuration int64 `json:"wait_duration" bson:"wait_duration,omitempty" description:"Wait duration (in millisecond)"`
RuntimeDuration int64 `json:"runtime_duration" bson:"runtime_duration,omitempty" description:"Runtime duration (in millisecond)"`
TotalDuration int64 `json:"total_duration" bson:"total_duration,omitempty" description:"Total duration (in millisecond)"`
ResultCount int64 `json:"result_count" bson:"result_count" description:"Result count"`
}