Files
archie/internal/contracts/state/v1/stats.pb.go
T
sam 4728c8c253 feat(usage): report model usage per org with identity and cost (#1855)
Model usage was recorded per call and never read, so an org could not see
what it spent. Add the read side:

- model_usage carries identity_id. Task calls take it from the task row,
  chat and curator calls from the calling principal carried in the usage
  record, so an outbox replay keeps its attribution. Existing task rows are
  backfilled from tasks.
- StatsService.UsageTotals sums the caller org's rows by UTC day, source,
  provider, model and identity. The org comes from the principal, with no
  org parameter, so cross-org reads do not exist.
- GET /api/usage prices tokens at the catalog's list rate, netting cache
  hits, and reports calls to unpriced models as tokens only. The published
  catalog view now carries each model's cost.
- A new org Usage page behind a read_usage grant: admin and owner only,
  with a 7, 30 or 90 day range, totals, the daily series, and model, source
  and identity breakdowns. The org shell keeps it on the caller's own org.
2026-11-11 02:15:29 +11:00

956 lines
29 KiB
Go

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: state/v1/stats.proto
package statev1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// WorkflowStat mirrors storecontract.WorkflowStat.
type WorkflowStat struct {
state protoimpl.MessageState `protogen:"open.v1"`
Workflow string `protobuf:"bytes,1,opt,name=workflow,proto3" json:"workflow,omitempty"`
Runs int64 `protobuf:"varint,2,opt,name=runs,proto3" json:"runs,omitempty"`
Merged int64 `protobuf:"varint,3,opt,name=merged,proto3" json:"merged,omitempty"`
PrOpen int64 `protobuf:"varint,4,opt,name=pr_open,json=prOpen,proto3" json:"pr_open,omitempty"`
Parked int64 `protobuf:"varint,5,opt,name=parked,proto3" json:"parked,omitempty"`
AvgTokens int64 `protobuf:"varint,6,opt,name=avg_tokens,json=avgTokens,proto3" json:"avg_tokens,omitempty"`
AvgSteps float64 `protobuf:"fixed64,7,opt,name=avg_steps,json=avgSteps,proto3" json:"avg_steps,omitempty"`
TotalTokens int64 `protobuf:"varint,8,opt,name=total_tokens,json=totalTokens,proto3" json:"total_tokens,omitempty"`
Completed int64 `protobuf:"varint,9,opt,name=completed,proto3" json:"completed,omitempty"`
// running and last_status describe the newest runs, so a workflow whose
// runs are older than a global task page still reports its real state.
Running int64 `protobuf:"varint,10,opt,name=running,proto3" json:"running,omitempty"`
LastStatus string `protobuf:"bytes,11,opt,name=last_status,json=lastStatus,proto3" json:"last_status,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *WorkflowStat) Reset() {
*x = WorkflowStat{}
mi := &file_state_v1_stats_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *WorkflowStat) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*WorkflowStat) ProtoMessage() {}
func (x *WorkflowStat) ProtoReflect() protoreflect.Message {
mi := &file_state_v1_stats_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use WorkflowStat.ProtoReflect.Descriptor instead.
func (*WorkflowStat) Descriptor() ([]byte, []int) {
return file_state_v1_stats_proto_rawDescGZIP(), []int{0}
}
func (x *WorkflowStat) GetWorkflow() string {
if x != nil {
return x.Workflow
}
return ""
}
func (x *WorkflowStat) GetRuns() int64 {
if x != nil {
return x.Runs
}
return 0
}
func (x *WorkflowStat) GetMerged() int64 {
if x != nil {
return x.Merged
}
return 0
}
func (x *WorkflowStat) GetPrOpen() int64 {
if x != nil {
return x.PrOpen
}
return 0
}
func (x *WorkflowStat) GetParked() int64 {
if x != nil {
return x.Parked
}
return 0
}
func (x *WorkflowStat) GetAvgTokens() int64 {
if x != nil {
return x.AvgTokens
}
return 0
}
func (x *WorkflowStat) GetAvgSteps() float64 {
if x != nil {
return x.AvgSteps
}
return 0
}
func (x *WorkflowStat) GetTotalTokens() int64 {
if x != nil {
return x.TotalTokens
}
return 0
}
func (x *WorkflowStat) GetCompleted() int64 {
if x != nil {
return x.Completed
}
return 0
}
func (x *WorkflowStat) GetRunning() int64 {
if x != nil {
return x.Running
}
return 0
}
func (x *WorkflowStat) GetLastStatus() string {
if x != nil {
return x.LastStatus
}
return ""
}
// StageStat mirrors storecontract.StageStat.
type StageStat struct {
state protoimpl.MessageState `protogen:"open.v1"`
Workflow string `protobuf:"bytes,1,opt,name=workflow,proto3" json:"workflow,omitempty"`
Stage string `protobuf:"bytes,2,opt,name=stage,proto3" json:"stage,omitempty"`
Runs int64 `protobuf:"varint,3,opt,name=runs,proto3" json:"runs,omitempty"`
AvgMs int64 `protobuf:"varint,4,opt,name=avg_ms,json=avgMs,proto3" json:"avg_ms,omitempty"`
Errors int64 `protobuf:"varint,5,opt,name=errors,proto3" json:"errors,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *StageStat) Reset() {
*x = StageStat{}
mi := &file_state_v1_stats_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *StageStat) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StageStat) ProtoMessage() {}
func (x *StageStat) ProtoReflect() protoreflect.Message {
mi := &file_state_v1_stats_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StageStat.ProtoReflect.Descriptor instead.
func (*StageStat) Descriptor() ([]byte, []int) {
return file_state_v1_stats_proto_rawDescGZIP(), []int{1}
}
func (x *StageStat) GetWorkflow() string {
if x != nil {
return x.Workflow
}
return ""
}
func (x *StageStat) GetStage() string {
if x != nil {
return x.Stage
}
return ""
}
func (x *StageStat) GetRuns() int64 {
if x != nil {
return x.Runs
}
return 0
}
func (x *StageStat) GetAvgMs() int64 {
if x != nil {
return x.AvgMs
}
return 0
}
func (x *StageStat) GetErrors() int64 {
if x != nil {
return x.Errors
}
return 0
}
// DayTokens mirrors storecontract.DayTokens.
type DayTokens struct {
state protoimpl.MessageState `protogen:"open.v1"`
Day string `protobuf:"bytes,1,opt,name=day,proto3" json:"day,omitempty"`
Tokens int64 `protobuf:"varint,2,opt,name=tokens,proto3" json:"tokens,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DayTokens) Reset() {
*x = DayTokens{}
mi := &file_state_v1_stats_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DayTokens) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DayTokens) ProtoMessage() {}
func (x *DayTokens) ProtoReflect() protoreflect.Message {
mi := &file_state_v1_stats_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DayTokens.ProtoReflect.Descriptor instead.
func (*DayTokens) Descriptor() ([]byte, []int) {
return file_state_v1_stats_proto_rawDescGZIP(), []int{2}
}
func (x *DayTokens) GetDay() string {
if x != nil {
return x.Day
}
return ""
}
func (x *DayTokens) GetTokens() int64 {
if x != nil {
return x.Tokens
}
return 0
}
type StatusCountsRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *StatusCountsRequest) Reset() {
*x = StatusCountsRequest{}
mi := &file_state_v1_stats_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *StatusCountsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StatusCountsRequest) ProtoMessage() {}
func (x *StatusCountsRequest) ProtoReflect() protoreflect.Message {
mi := &file_state_v1_stats_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StatusCountsRequest.ProtoReflect.Descriptor instead.
func (*StatusCountsRequest) Descriptor() ([]byte, []int) {
return file_state_v1_stats_proto_rawDescGZIP(), []int{3}
}
type StatusCountsResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Counts map[string]int64 `protobuf:"bytes,1,rep,name=counts,proto3" json:"counts,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *StatusCountsResponse) Reset() {
*x = StatusCountsResponse{}
mi := &file_state_v1_stats_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *StatusCountsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StatusCountsResponse) ProtoMessage() {}
func (x *StatusCountsResponse) ProtoReflect() protoreflect.Message {
mi := &file_state_v1_stats_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StatusCountsResponse.ProtoReflect.Descriptor instead.
func (*StatusCountsResponse) Descriptor() ([]byte, []int) {
return file_state_v1_stats_proto_rawDescGZIP(), []int{4}
}
func (x *StatusCountsResponse) GetCounts() map[string]int64 {
if x != nil {
return x.Counts
}
return nil
}
type WorkflowStatsRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *WorkflowStatsRequest) Reset() {
*x = WorkflowStatsRequest{}
mi := &file_state_v1_stats_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *WorkflowStatsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*WorkflowStatsRequest) ProtoMessage() {}
func (x *WorkflowStatsRequest) ProtoReflect() protoreflect.Message {
mi := &file_state_v1_stats_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use WorkflowStatsRequest.ProtoReflect.Descriptor instead.
func (*WorkflowStatsRequest) Descriptor() ([]byte, []int) {
return file_state_v1_stats_proto_rawDescGZIP(), []int{5}
}
type WorkflowStatsResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Stats []*WorkflowStat `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *WorkflowStatsResponse) Reset() {
*x = WorkflowStatsResponse{}
mi := &file_state_v1_stats_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *WorkflowStatsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*WorkflowStatsResponse) ProtoMessage() {}
func (x *WorkflowStatsResponse) ProtoReflect() protoreflect.Message {
mi := &file_state_v1_stats_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use WorkflowStatsResponse.ProtoReflect.Descriptor instead.
func (*WorkflowStatsResponse) Descriptor() ([]byte, []int) {
return file_state_v1_stats_proto_rawDescGZIP(), []int{6}
}
func (x *WorkflowStatsResponse) GetStats() []*WorkflowStat {
if x != nil {
return x.Stats
}
return nil
}
type StageStatsRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *StageStatsRequest) Reset() {
*x = StageStatsRequest{}
mi := &file_state_v1_stats_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *StageStatsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StageStatsRequest) ProtoMessage() {}
func (x *StageStatsRequest) ProtoReflect() protoreflect.Message {
mi := &file_state_v1_stats_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StageStatsRequest.ProtoReflect.Descriptor instead.
func (*StageStatsRequest) Descriptor() ([]byte, []int) {
return file_state_v1_stats_proto_rawDescGZIP(), []int{7}
}
type StageStatsResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Stats []*StageStat `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *StageStatsResponse) Reset() {
*x = StageStatsResponse{}
mi := &file_state_v1_stats_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *StageStatsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StageStatsResponse) ProtoMessage() {}
func (x *StageStatsResponse) ProtoReflect() protoreflect.Message {
mi := &file_state_v1_stats_proto_msgTypes[8]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StageStatsResponse.ProtoReflect.Descriptor instead.
func (*StageStatsResponse) Descriptor() ([]byte, []int) {
return file_state_v1_stats_proto_rawDescGZIP(), []int{8}
}
func (x *StageStatsResponse) GetStats() []*StageStat {
if x != nil {
return x.Stats
}
return nil
}
type TokensByDayRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Days int64 `protobuf:"varint,1,opt,name=days,proto3" json:"days,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *TokensByDayRequest) Reset() {
*x = TokensByDayRequest{}
mi := &file_state_v1_stats_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *TokensByDayRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TokensByDayRequest) ProtoMessage() {}
func (x *TokensByDayRequest) ProtoReflect() protoreflect.Message {
mi := &file_state_v1_stats_proto_msgTypes[9]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TokensByDayRequest.ProtoReflect.Descriptor instead.
func (*TokensByDayRequest) Descriptor() ([]byte, []int) {
return file_state_v1_stats_proto_rawDescGZIP(), []int{9}
}
func (x *TokensByDayRequest) GetDays() int64 {
if x != nil {
return x.Days
}
return 0
}
type TokensByDayResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Tokens []*DayTokens `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *TokensByDayResponse) Reset() {
*x = TokensByDayResponse{}
mi := &file_state_v1_stats_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *TokensByDayResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TokensByDayResponse) ProtoMessage() {}
func (x *TokensByDayResponse) ProtoReflect() protoreflect.Message {
mi := &file_state_v1_stats_proto_msgTypes[10]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TokensByDayResponse.ProtoReflect.Descriptor instead.
func (*TokensByDayResponse) Descriptor() ([]byte, []int) {
return file_state_v1_stats_proto_rawDescGZIP(), []int{10}
}
func (x *TokensByDayResponse) GetTokens() []*DayTokens {
if x != nil {
return x.Tokens
}
return nil
}
// UsageTotalRow is one cell of a model-usage report: the day, source,
// provider, model and identity the calls belong to, and the tokens they
// used. Cost is not carried: the reader prices the tokens against the model
// catalog, so a price change is a change of interpretation, not of history.
type UsageTotalRow struct {
state protoimpl.MessageState `protogen:"open.v1"`
Day string `protobuf:"bytes,1,opt,name=day,proto3" json:"day,omitempty"`
Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
Provider string `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"`
Model string `protobuf:"bytes,4,opt,name=model,proto3" json:"model,omitempty"`
// identity is who the work was requested as, empty when unknown.
Identity string `protobuf:"bytes,5,opt,name=identity,proto3" json:"identity,omitempty"`
Calls int64 `protobuf:"varint,6,opt,name=calls,proto3" json:"calls,omitempty"`
InputTokens int64 `protobuf:"varint,7,opt,name=input_tokens,json=inputTokens,proto3" json:"input_tokens,omitempty"`
OutputTokens int64 `protobuf:"varint,8,opt,name=output_tokens,json=outputTokens,proto3" json:"output_tokens,omitempty"`
CachedTokens int64 `protobuf:"varint,9,opt,name=cached_tokens,json=cachedTokens,proto3" json:"cached_tokens,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UsageTotalRow) Reset() {
*x = UsageTotalRow{}
mi := &file_state_v1_stats_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UsageTotalRow) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UsageTotalRow) ProtoMessage() {}
func (x *UsageTotalRow) ProtoReflect() protoreflect.Message {
mi := &file_state_v1_stats_proto_msgTypes[11]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UsageTotalRow.ProtoReflect.Descriptor instead.
func (*UsageTotalRow) Descriptor() ([]byte, []int) {
return file_state_v1_stats_proto_rawDescGZIP(), []int{11}
}
func (x *UsageTotalRow) GetDay() string {
if x != nil {
return x.Day
}
return ""
}
func (x *UsageTotalRow) GetSource() string {
if x != nil {
return x.Source
}
return ""
}
func (x *UsageTotalRow) GetProvider() string {
if x != nil {
return x.Provider
}
return ""
}
func (x *UsageTotalRow) GetModel() string {
if x != nil {
return x.Model
}
return ""
}
func (x *UsageTotalRow) GetIdentity() string {
if x != nil {
return x.Identity
}
return ""
}
func (x *UsageTotalRow) GetCalls() int64 {
if x != nil {
return x.Calls
}
return 0
}
func (x *UsageTotalRow) GetInputTokens() int64 {
if x != nil {
return x.InputTokens
}
return 0
}
func (x *UsageTotalRow) GetOutputTokens() int64 {
if x != nil {
return x.OutputTokens
}
return 0
}
func (x *UsageTotalRow) GetCachedTokens() int64 {
if x != nil {
return x.CachedTokens
}
return 0
}
// UsageTotalsRequest names the range ending now, in days.
type UsageTotalsRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Days int64 `protobuf:"varint,1,opt,name=days,proto3" json:"days,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UsageTotalsRequest) Reset() {
*x = UsageTotalsRequest{}
mi := &file_state_v1_stats_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UsageTotalsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UsageTotalsRequest) ProtoMessage() {}
func (x *UsageTotalsRequest) ProtoReflect() protoreflect.Message {
mi := &file_state_v1_stats_proto_msgTypes[12]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UsageTotalsRequest.ProtoReflect.Descriptor instead.
func (*UsageTotalsRequest) Descriptor() ([]byte, []int) {
return file_state_v1_stats_proto_rawDescGZIP(), []int{12}
}
func (x *UsageTotalsRequest) GetDays() int64 {
if x != nil {
return x.Days
}
return 0
}
type UsageTotalsResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Rows []*UsageTotalRow `protobuf:"bytes,1,rep,name=rows,proto3" json:"rows,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UsageTotalsResponse) Reset() {
*x = UsageTotalsResponse{}
mi := &file_state_v1_stats_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UsageTotalsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UsageTotalsResponse) ProtoMessage() {}
func (x *UsageTotalsResponse) ProtoReflect() protoreflect.Message {
mi := &file_state_v1_stats_proto_msgTypes[13]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UsageTotalsResponse.ProtoReflect.Descriptor instead.
func (*UsageTotalsResponse) Descriptor() ([]byte, []int) {
return file_state_v1_stats_proto_rawDescGZIP(), []int{13}
}
func (x *UsageTotalsResponse) GetRows() []*UsageTotalRow {
if x != nil {
return x.Rows
}
return nil
}
var File_state_v1_stats_proto protoreflect.FileDescriptor
const file_state_v1_stats_proto_rawDesc = "" +
"\n" +
"\x14state/v1/stats.proto\x12\bstate.v1\"\xbf\x02\n" +
"\fWorkflowStat\x12\x1a\n" +
"\bworkflow\x18\x01 \x01(\tR\bworkflow\x12\x12\n" +
"\x04runs\x18\x02 \x01(\x03R\x04runs\x12\x16\n" +
"\x06merged\x18\x03 \x01(\x03R\x06merged\x12\x17\n" +
"\apr_open\x18\x04 \x01(\x03R\x06prOpen\x12\x16\n" +
"\x06parked\x18\x05 \x01(\x03R\x06parked\x12\x1d\n" +
"\n" +
"avg_tokens\x18\x06 \x01(\x03R\tavgTokens\x12\x1b\n" +
"\tavg_steps\x18\a \x01(\x01R\bavgSteps\x12!\n" +
"\ftotal_tokens\x18\b \x01(\x03R\vtotalTokens\x12\x1c\n" +
"\tcompleted\x18\t \x01(\x03R\tcompleted\x12\x18\n" +
"\arunning\x18\n" +
" \x01(\x03R\arunning\x12\x1f\n" +
"\vlast_status\x18\v \x01(\tR\n" +
"lastStatus\"\x80\x01\n" +
"\tStageStat\x12\x1a\n" +
"\bworkflow\x18\x01 \x01(\tR\bworkflow\x12\x14\n" +
"\x05stage\x18\x02 \x01(\tR\x05stage\x12\x12\n" +
"\x04runs\x18\x03 \x01(\x03R\x04runs\x12\x15\n" +
"\x06avg_ms\x18\x04 \x01(\x03R\x05avgMs\x12\x16\n" +
"\x06errors\x18\x05 \x01(\x03R\x06errors\"5\n" +
"\tDayTokens\x12\x10\n" +
"\x03day\x18\x01 \x01(\tR\x03day\x12\x16\n" +
"\x06tokens\x18\x02 \x01(\x03R\x06tokens\"\x15\n" +
"\x13StatusCountsRequest\"\x95\x01\n" +
"\x14StatusCountsResponse\x12B\n" +
"\x06counts\x18\x01 \x03(\v2*.state.v1.StatusCountsResponse.CountsEntryR\x06counts\x1a9\n" +
"\vCountsEntry\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
"\x05value\x18\x02 \x01(\x03R\x05value:\x028\x01\"\x16\n" +
"\x14WorkflowStatsRequest\"E\n" +
"\x15WorkflowStatsResponse\x12,\n" +
"\x05stats\x18\x01 \x03(\v2\x16.state.v1.WorkflowStatR\x05stats\"\x13\n" +
"\x11StageStatsRequest\"?\n" +
"\x12StageStatsResponse\x12)\n" +
"\x05stats\x18\x01 \x03(\v2\x13.state.v1.StageStatR\x05stats\"(\n" +
"\x12TokensByDayRequest\x12\x12\n" +
"\x04days\x18\x01 \x01(\x03R\x04days\"B\n" +
"\x13TokensByDayResponse\x12+\n" +
"\x06tokens\x18\x01 \x03(\v2\x13.state.v1.DayTokensR\x06tokens\"\x8a\x02\n" +
"\rUsageTotalRow\x12\x10\n" +
"\x03day\x18\x01 \x01(\tR\x03day\x12\x16\n" +
"\x06source\x18\x02 \x01(\tR\x06source\x12\x1a\n" +
"\bprovider\x18\x03 \x01(\tR\bprovider\x12\x14\n" +
"\x05model\x18\x04 \x01(\tR\x05model\x12\x1a\n" +
"\bidentity\x18\x05 \x01(\tR\bidentity\x12\x14\n" +
"\x05calls\x18\x06 \x01(\x03R\x05calls\x12!\n" +
"\finput_tokens\x18\a \x01(\x03R\vinputTokens\x12#\n" +
"\routput_tokens\x18\b \x01(\x03R\foutputTokens\x12#\n" +
"\rcached_tokens\x18\t \x01(\x03R\fcachedTokens\"(\n" +
"\x12UsageTotalsRequest\x12\x12\n" +
"\x04days\x18\x01 \x01(\x03R\x04days\"B\n" +
"\x13UsageTotalsResponse\x12+\n" +
"\x04rows\x18\x01 \x03(\v2\x17.state.v1.UsageTotalRowR\x04rows2\x90\x03\n" +
"\fStatsService\x12M\n" +
"\fStatusCounts\x12\x1d.state.v1.StatusCountsRequest\x1a\x1e.state.v1.StatusCountsResponse\x12P\n" +
"\rWorkflowStats\x12\x1e.state.v1.WorkflowStatsRequest\x1a\x1f.state.v1.WorkflowStatsResponse\x12G\n" +
"\n" +
"StageStats\x12\x1b.state.v1.StageStatsRequest\x1a\x1c.state.v1.StageStatsResponse\x12J\n" +
"\vTokensByDay\x12\x1c.state.v1.TokensByDayRequest\x1a\x1d.state.v1.TokensByDayResponse\x12J\n" +
"\vUsageTotals\x12\x1c.state.v1.UsageTotalsRequest\x1a\x1d.state.v1.UsageTotalsResponseB\xa4\x01\n" +
"\fcom.state.v1B\n" +
"StatsProtoP\x01ZGgithub.com/samcharles93/archie-core/internal/contracts/state/v1;statev1\xa2\x02\x03SXX\xaa\x02\bState.V1\xca\x02\bState\\V1\xe2\x02\x14State\\V1\\GPBMetadata\xea\x02\tState::V1b\x06proto3"
var (
file_state_v1_stats_proto_rawDescOnce sync.Once
file_state_v1_stats_proto_rawDescData []byte
)
func file_state_v1_stats_proto_rawDescGZIP() []byte {
file_state_v1_stats_proto_rawDescOnce.Do(func() {
file_state_v1_stats_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_state_v1_stats_proto_rawDesc), len(file_state_v1_stats_proto_rawDesc)))
})
return file_state_v1_stats_proto_rawDescData
}
var file_state_v1_stats_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
var file_state_v1_stats_proto_goTypes = []any{
(*WorkflowStat)(nil), // 0: state.v1.WorkflowStat
(*StageStat)(nil), // 1: state.v1.StageStat
(*DayTokens)(nil), // 2: state.v1.DayTokens
(*StatusCountsRequest)(nil), // 3: state.v1.StatusCountsRequest
(*StatusCountsResponse)(nil), // 4: state.v1.StatusCountsResponse
(*WorkflowStatsRequest)(nil), // 5: state.v1.WorkflowStatsRequest
(*WorkflowStatsResponse)(nil), // 6: state.v1.WorkflowStatsResponse
(*StageStatsRequest)(nil), // 7: state.v1.StageStatsRequest
(*StageStatsResponse)(nil), // 8: state.v1.StageStatsResponse
(*TokensByDayRequest)(nil), // 9: state.v1.TokensByDayRequest
(*TokensByDayResponse)(nil), // 10: state.v1.TokensByDayResponse
(*UsageTotalRow)(nil), // 11: state.v1.UsageTotalRow
(*UsageTotalsRequest)(nil), // 12: state.v1.UsageTotalsRequest
(*UsageTotalsResponse)(nil), // 13: state.v1.UsageTotalsResponse
nil, // 14: state.v1.StatusCountsResponse.CountsEntry
}
var file_state_v1_stats_proto_depIdxs = []int32{
14, // 0: state.v1.StatusCountsResponse.counts:type_name -> state.v1.StatusCountsResponse.CountsEntry
0, // 1: state.v1.WorkflowStatsResponse.stats:type_name -> state.v1.WorkflowStat
1, // 2: state.v1.StageStatsResponse.stats:type_name -> state.v1.StageStat
2, // 3: state.v1.TokensByDayResponse.tokens:type_name -> state.v1.DayTokens
11, // 4: state.v1.UsageTotalsResponse.rows:type_name -> state.v1.UsageTotalRow
3, // 5: state.v1.StatsService.StatusCounts:input_type -> state.v1.StatusCountsRequest
5, // 6: state.v1.StatsService.WorkflowStats:input_type -> state.v1.WorkflowStatsRequest
7, // 7: state.v1.StatsService.StageStats:input_type -> state.v1.StageStatsRequest
9, // 8: state.v1.StatsService.TokensByDay:input_type -> state.v1.TokensByDayRequest
12, // 9: state.v1.StatsService.UsageTotals:input_type -> state.v1.UsageTotalsRequest
4, // 10: state.v1.StatsService.StatusCounts:output_type -> state.v1.StatusCountsResponse
6, // 11: state.v1.StatsService.WorkflowStats:output_type -> state.v1.WorkflowStatsResponse
8, // 12: state.v1.StatsService.StageStats:output_type -> state.v1.StageStatsResponse
10, // 13: state.v1.StatsService.TokensByDay:output_type -> state.v1.TokensByDayResponse
13, // 14: state.v1.StatsService.UsageTotals:output_type -> state.v1.UsageTotalsResponse
10, // [10:15] is the sub-list for method output_type
5, // [5:10] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
}
func init() { file_state_v1_stats_proto_init() }
func file_state_v1_stats_proto_init() {
if File_state_v1_stats_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_state_v1_stats_proto_rawDesc), len(file_state_v1_stats_proto_rawDesc)),
NumEnums: 0,
NumMessages: 15,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_state_v1_stats_proto_goTypes,
DependencyIndexes: file_state_v1_stats_proto_depIdxs,
MessageInfos: file_state_v1_stats_proto_msgTypes,
}.Build()
File_state_v1_stats_proto = out.File
file_state_v1_stats_proto_goTypes = nil
file_state_v1_stats_proto_depIdxs = nil
}