analyticsv1

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnalyticsService_Record_FullMethodName       = "/tokman.analytics.v1.AnalyticsService/Record"
	AnalyticsService_GetMetrics_FullMethodName   = "/tokman.analytics.v1.AnalyticsService/GetMetrics"
	AnalyticsService_GetEconomics_FullMethodName = "/tokman.analytics.v1.AnalyticsService/GetEconomics"
)

Variables

View Source
var AnalyticsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "tokman.analytics.v1.AnalyticsService",
	HandlerType: (*AnalyticsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Record",
			Handler:    _AnalyticsService_Record_Handler,
		},
		{
			MethodName: "GetMetrics",
			Handler:    _AnalyticsService_GetMetrics_Handler,
		},
		{
			MethodName: "GetEconomics",
			Handler:    _AnalyticsService_GetEconomics_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/analytics.proto",
}

AnalyticsService_ServiceDesc is the grpc.ServiceDesc for AnalyticsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_proto_analytics_proto protoreflect.FileDescriptor

Functions

func RegisterAnalyticsServiceServer

func RegisterAnalyticsServiceServer(s grpc.ServiceRegistrar, srv AnalyticsServiceServer)

Types

type AnalyticsServiceClient

type AnalyticsServiceClient interface {
	// Record saves a command execution record.
	Record(ctx context.Context, in *RecordRequest, opts ...grpc.CallOption) (*RecordResponse, error)
	// GetMetrics returns aggregated metrics.
	GetMetrics(ctx context.Context, in *GetMetricsRequest, opts ...grpc.CallOption) (*GetMetricsResponse, error)
	// GetEconomics returns cost analysis.
	GetEconomics(ctx context.Context, in *GetEconomicsRequest, opts ...grpc.CallOption) (*GetEconomicsResponse, error)
}

AnalyticsServiceClient is the client API for AnalyticsService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

Analytics service handles token tracking and metrics.

type AnalyticsServiceServer

type AnalyticsServiceServer interface {
	// Record saves a command execution record.
	Record(context.Context, *RecordRequest) (*RecordResponse, error)
	// GetMetrics returns aggregated metrics.
	GetMetrics(context.Context, *GetMetricsRequest) (*GetMetricsResponse, error)
	// GetEconomics returns cost analysis.
	GetEconomics(context.Context, *GetEconomicsRequest) (*GetEconomicsResponse, error)
	// contains filtered or unexported methods
}

AnalyticsServiceServer is the server API for AnalyticsService service. All implementations must embed UnimplementedAnalyticsServiceServer for forward compatibility.

Analytics service handles token tracking and metrics.

type FilterUsage

type FilterUsage struct {
	FilterName string  `protobuf:"bytes,1,opt,name=filter_name,json=filterName,proto3" json:"filter_name,omitempty"`
	Count      int64   `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
	AvgSavings float64 `protobuf:"fixed64,3,opt,name=avg_savings,json=avgSavings,proto3" json:"avg_savings,omitempty"`
	// contains filtered or unexported fields
}

func (*FilterUsage) Descriptor deprecated

func (*FilterUsage) Descriptor() ([]byte, []int)

Deprecated: Use FilterUsage.ProtoReflect.Descriptor instead.

func (*FilterUsage) GetAvgSavings

func (x *FilterUsage) GetAvgSavings() float64

func (*FilterUsage) GetCount

func (x *FilterUsage) GetCount() int64

func (*FilterUsage) GetFilterName

func (x *FilterUsage) GetFilterName() string

func (*FilterUsage) ProtoMessage

func (*FilterUsage) ProtoMessage()

func (*FilterUsage) ProtoReflect

func (x *FilterUsage) ProtoReflect() protoreflect.Message

func (*FilterUsage) Reset

func (x *FilterUsage) Reset()

func (*FilterUsage) String

func (x *FilterUsage) String() string

type GetEconomicsRequest

type GetEconomicsRequest struct {
	// contains filtered or unexported fields
}

func (*GetEconomicsRequest) Descriptor deprecated

func (*GetEconomicsRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetEconomicsRequest.ProtoReflect.Descriptor instead.

func (*GetEconomicsRequest) ProtoMessage

func (*GetEconomicsRequest) ProtoMessage()

func (*GetEconomicsRequest) ProtoReflect

func (x *GetEconomicsRequest) ProtoReflect() protoreflect.Message

func (*GetEconomicsRequest) Reset

func (x *GetEconomicsRequest) Reset()

func (*GetEconomicsRequest) String

func (x *GetEconomicsRequest) String() string

type GetEconomicsResponse

type GetEconomicsResponse struct {
	TokensSaved        int64   `protobuf:"varint,1,opt,name=tokens_saved,json=tokensSaved,proto3" json:"tokens_saved,omitempty"`
	EstimatedCostSaved float64 `protobuf:"fixed64,2,opt,name=estimated_cost_saved,json=estimatedCostSaved,proto3" json:"estimated_cost_saved,omitempty"`
	ModelUsed          string  `protobuf:"bytes,3,opt,name=model_used,json=modelUsed,proto3" json:"model_used,omitempty"`
	CostPerToken       float64 `protobuf:"fixed64,4,opt,name=cost_per_token,json=costPerToken,proto3" json:"cost_per_token,omitempty"`
	QuotaUsed          float64 `protobuf:"fixed64,5,opt,name=quota_used,json=quotaUsed,proto3" json:"quota_used,omitempty"`
	QuotaRemaining     float64 `protobuf:"fixed64,6,opt,name=quota_remaining,json=quotaRemaining,proto3" json:"quota_remaining,omitempty"`
	// contains filtered or unexported fields
}

func (*GetEconomicsResponse) Descriptor deprecated

func (*GetEconomicsResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetEconomicsResponse.ProtoReflect.Descriptor instead.

func (*GetEconomicsResponse) GetCostPerToken

func (x *GetEconomicsResponse) GetCostPerToken() float64

func (*GetEconomicsResponse) GetEstimatedCostSaved

func (x *GetEconomicsResponse) GetEstimatedCostSaved() float64

func (*GetEconomicsResponse) GetModelUsed

func (x *GetEconomicsResponse) GetModelUsed() string

func (*GetEconomicsResponse) GetQuotaRemaining

func (x *GetEconomicsResponse) GetQuotaRemaining() float64

func (*GetEconomicsResponse) GetQuotaUsed

func (x *GetEconomicsResponse) GetQuotaUsed() float64

func (*GetEconomicsResponse) GetTokensSaved

func (x *GetEconomicsResponse) GetTokensSaved() int64

func (*GetEconomicsResponse) ProtoMessage

func (*GetEconomicsResponse) ProtoMessage()

func (*GetEconomicsResponse) ProtoReflect

func (x *GetEconomicsResponse) ProtoReflect() protoreflect.Message

func (*GetEconomicsResponse) Reset

func (x *GetEconomicsResponse) Reset()

func (*GetEconomicsResponse) String

func (x *GetEconomicsResponse) String() string

type GetMetricsRequest

type GetMetricsRequest struct {
	StartTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	EndTime   *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
	SessionId string                 `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetMetricsRequest) Descriptor deprecated

func (*GetMetricsRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetMetricsRequest.ProtoReflect.Descriptor instead.

func (*GetMetricsRequest) GetEndTime

func (x *GetMetricsRequest) GetEndTime() *timestamppb.Timestamp

func (*GetMetricsRequest) GetSessionId

func (x *GetMetricsRequest) GetSessionId() string

func (*GetMetricsRequest) GetStartTime

func (x *GetMetricsRequest) GetStartTime() *timestamppb.Timestamp

func (*GetMetricsRequest) ProtoMessage

func (*GetMetricsRequest) ProtoMessage()

func (*GetMetricsRequest) ProtoReflect

func (x *GetMetricsRequest) ProtoReflect() protoreflect.Message

func (*GetMetricsRequest) Reset

func (x *GetMetricsRequest) Reset()

func (*GetMetricsRequest) String

func (x *GetMetricsRequest) String() string

type GetMetricsResponse

type GetMetricsResponse struct {
	TotalCommands    int64          `protobuf:"varint,1,opt,name=total_commands,json=totalCommands,proto3" json:"total_commands,omitempty"`
	TotalTokensSaved int64          `protobuf:"varint,2,opt,name=total_tokens_saved,json=totalTokensSaved,proto3" json:"total_tokens_saved,omitempty"`
	TotalTokensIn    int64          `protobuf:"varint,3,opt,name=total_tokens_in,json=totalTokensIn,proto3" json:"total_tokens_in,omitempty"`
	TotalTokensOut   int64          `protobuf:"varint,4,opt,name=total_tokens_out,json=totalTokensOut,proto3" json:"total_tokens_out,omitempty"`
	AverageSavings   float64        `protobuf:"fixed64,5,opt,name=average_savings,json=averageSavings,proto3" json:"average_savings,omitempty"`
	P50LatencyMs     float64        `protobuf:"fixed64,6,opt,name=p50_latency_ms,json=p50LatencyMs,proto3" json:"p50_latency_ms,omitempty"`
	P99LatencyMs     float64        `protobuf:"fixed64,7,opt,name=p99_latency_ms,json=p99LatencyMs,proto3" json:"p99_latency_ms,omitempty"`
	TopFilters       []*FilterUsage `protobuf:"bytes,8,rep,name=top_filters,json=topFilters,proto3" json:"top_filters,omitempty"`
	// contains filtered or unexported fields
}

func (*GetMetricsResponse) Descriptor deprecated

func (*GetMetricsResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetMetricsResponse.ProtoReflect.Descriptor instead.

func (*GetMetricsResponse) GetAverageSavings

func (x *GetMetricsResponse) GetAverageSavings() float64

func (*GetMetricsResponse) GetP50LatencyMs

func (x *GetMetricsResponse) GetP50LatencyMs() float64

func (*GetMetricsResponse) GetP99LatencyMs

func (x *GetMetricsResponse) GetP99LatencyMs() float64

func (*GetMetricsResponse) GetTopFilters

func (x *GetMetricsResponse) GetTopFilters() []*FilterUsage

func (*GetMetricsResponse) GetTotalCommands

func (x *GetMetricsResponse) GetTotalCommands() int64

func (*GetMetricsResponse) GetTotalTokensIn

func (x *GetMetricsResponse) GetTotalTokensIn() int64

func (*GetMetricsResponse) GetTotalTokensOut

func (x *GetMetricsResponse) GetTotalTokensOut() int64

func (*GetMetricsResponse) GetTotalTokensSaved

func (x *GetMetricsResponse) GetTotalTokensSaved() int64

func (*GetMetricsResponse) ProtoMessage

func (*GetMetricsResponse) ProtoMessage()

func (*GetMetricsResponse) ProtoReflect

func (x *GetMetricsResponse) ProtoReflect() protoreflect.Message

func (*GetMetricsResponse) Reset

func (x *GetMetricsResponse) Reset()

func (*GetMetricsResponse) String

func (x *GetMetricsResponse) String() string

type RecordRequest

type RecordRequest struct {
	Command        string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"`
	OriginalTokens int32  `protobuf:"varint,2,opt,name=original_tokens,json=originalTokens,proto3" json:"original_tokens,omitempty"`
	FilteredTokens int32  `protobuf:"varint,3,opt,name=filtered_tokens,json=filteredTokens,proto3" json:"filtered_tokens,omitempty"`
	DurationMs     int64  `protobuf:"varint,4,opt,name=duration_ms,json=durationMs,proto3" json:"duration_ms,omitempty"`
	ExitCode       int32  `protobuf:"varint,5,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
	FilterMode     string `protobuf:"bytes,6,opt,name=filter_mode,json=filterMode,proto3" json:"filter_mode,omitempty"`
	SessionId      string `protobuf:"bytes,7,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	// contains filtered or unexported fields
}

func (*RecordRequest) Descriptor deprecated

func (*RecordRequest) Descriptor() ([]byte, []int)

Deprecated: Use RecordRequest.ProtoReflect.Descriptor instead.

func (*RecordRequest) GetCommand

func (x *RecordRequest) GetCommand() string

func (*RecordRequest) GetDurationMs

func (x *RecordRequest) GetDurationMs() int64

func (*RecordRequest) GetExitCode

func (x *RecordRequest) GetExitCode() int32

func (*RecordRequest) GetFilterMode

func (x *RecordRequest) GetFilterMode() string

func (*RecordRequest) GetFilteredTokens

func (x *RecordRequest) GetFilteredTokens() int32

func (*RecordRequest) GetOriginalTokens

func (x *RecordRequest) GetOriginalTokens() int32

func (*RecordRequest) GetSessionId

func (x *RecordRequest) GetSessionId() string

func (*RecordRequest) ProtoMessage

func (*RecordRequest) ProtoMessage()

func (*RecordRequest) ProtoReflect

func (x *RecordRequest) ProtoReflect() protoreflect.Message

func (*RecordRequest) Reset

func (x *RecordRequest) Reset()

func (*RecordRequest) String

func (x *RecordRequest) String() string

type RecordResponse

type RecordResponse struct {
	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	// contains filtered or unexported fields
}

func (*RecordResponse) Descriptor deprecated

func (*RecordResponse) Descriptor() ([]byte, []int)

Deprecated: Use RecordResponse.ProtoReflect.Descriptor instead.

func (*RecordResponse) GetSuccess

func (x *RecordResponse) GetSuccess() bool

func (*RecordResponse) ProtoMessage

func (*RecordResponse) ProtoMessage()

func (*RecordResponse) ProtoReflect

func (x *RecordResponse) ProtoReflect() protoreflect.Message

func (*RecordResponse) Reset

func (x *RecordResponse) Reset()

func (*RecordResponse) String

func (x *RecordResponse) String() string

type UnimplementedAnalyticsServiceServer

type UnimplementedAnalyticsServiceServer struct{}

UnimplementedAnalyticsServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedAnalyticsServiceServer) GetEconomics

func (UnimplementedAnalyticsServiceServer) GetMetrics

func (UnimplementedAnalyticsServiceServer) Record

type UnsafeAnalyticsServiceServer

type UnsafeAnalyticsServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeAnalyticsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AnalyticsServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL