Documentation
¶
Index ¶
- func Tokens(text string) (int, error)
- type Entry
- type Stats
- func (s *Stats) A2AMessages() int
- func (s *Stats) A2AReq(duration time.Duration, reqt, respt, reqb, respb int)
- func (s *Stats) Add(other *Stats) *Stats
- func (s *Stats) AverageA2AReqBytes() float64
- func (s *Stats) AverageA2AReqDuration() time.Duration
- func (s *Stats) AverageA2AReqTokens() float64
- func (s *Stats) AverageA2ARespBytes() float64
- func (s *Stats) AverageA2ARespTokens() float64
- func (s *Stats) AverageLLMReqBytes() float64
- func (s *Stats) AverageLLMReqDuration() time.Duration
- func (s *Stats) AverageLLMReqTokens() float64
- func (s *Stats) AverageLLMRespBytes() float64
- func (s *Stats) AverageLLMRespTokens() float64
- func (s *Stats) Entries() []Entry
- func (s *Stats) LLMReq(duration time.Duration, reqt, respt, reqb, respb int)
- func (s *Stats) TotalA2ABytes() int
- func (s *Stats) TotalA2AReqBytes() int
- func (s *Stats) TotalA2AReqDuration() time.Duration
- func (s *Stats) TotalA2AReqTokens() int
- func (s *Stats) TotalA2ARespBytes() int
- func (s *Stats) TotalA2ARespTokens() int
- func (s *Stats) TotalA2ATokens() int
- func (s *Stats) TotalLLMBytes() int
- func (s *Stats) TotalLLMReqBytes() int
- func (s *Stats) TotalLLMReqDuration() time.Duration
- func (s *Stats) TotalLLMReqTokens() int
- func (s *Stats) TotalLLMRequests() []time.Duration
- func (s *Stats) TotalLLMRespBytes() int
- func (s *Stats) TotalLLMRespTokens() int
- func (s *Stats) TotalLLMTokens() int
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Entry ¶
type Entry struct {
// Title is the name of the statistic.
Title string
// Value is the value of the statistic, formatted as a string.
Value string
}
Entry is a struct that represents a single entry in the statistics.
type Stats ¶
type Stats struct {
// name is a string that represents the name of the statistics.
Name string
// contains filtered or unexported fields
}
Stats is a struct that contains interaction statistics between components.
func (*Stats) A2AMessages ¶
A2AMessages returns the number of A2A requests.
func (*Stats) Add ¶ added in v0.2.1
Add combines the current Stats instance with another and returns a new Stats instance. It does not mutate either of the original Stats instances.
func (*Stats) AverageA2AReqBytes ¶
AverageA2AReqBytes calculates the average number of A2A request bytes.
func (*Stats) AverageA2AReqDuration ¶
AverageA2AReqDuration calculates the average duration of A2A requests.
func (*Stats) AverageA2AReqTokens ¶
AverageA2AReqTokens calculates the average number of A2A request tokens.
func (*Stats) AverageA2ARespBytes ¶
AverageA2ARespBytes calculates the average number of A2A response bytes.
func (*Stats) AverageA2ARespTokens ¶
AverageA2ARespTokens calculates the average number of A2A response tokens.
func (*Stats) AverageLLMReqBytes ¶
AverageLLMReqBytes calculates the average number of LLM request bytes.
func (*Stats) AverageLLMReqDuration ¶
AverageLLMReqDuration calculates the average duration of LLM requests.
func (*Stats) AverageLLMReqTokens ¶
AverageLLMReqTokens calculates the average number of LLM request tokens.
func (*Stats) AverageLLMRespBytes ¶
AverageLLMRespBytes calculates the average number of LLM response bytes.
func (*Stats) AverageLLMRespTokens ¶
AverageLLMRespTokens calculates the average number of LLM response tokens.
func (*Stats) TotalA2ABytes ¶
TotalA2ABytes calculates the total A2A bytes (request + response).
func (*Stats) TotalA2AReqBytes ¶
TotalA2AReqBytes calculates the total A2A request bytes.
func (*Stats) TotalA2AReqDuration ¶
TotalA2AReqDuration calculates the total duration of A2A requests.
func (*Stats) TotalA2AReqTokens ¶
TotalA2AReqTokens calculates the total A2A request tokens.
func (*Stats) TotalA2ARespBytes ¶
TotalA2ARespBytes calculates the total A2A response bytes.
func (*Stats) TotalA2ARespTokens ¶
TotalA2ARespTokens calculates the total A2A response tokens.
func (*Stats) TotalA2ATokens ¶
TotalA2ATokens calculates the total A2A tokens (request + response).
func (*Stats) TotalLLMBytes ¶
TotalLLMBytes calculates the total LLM bytes (request + response).
func (*Stats) TotalLLMReqBytes ¶
TotalLLMReqBytes calculates the total LLM request bytes.
func (*Stats) TotalLLMReqDuration ¶
TotalLLMReqDuration calculates the total duration of LLM requests.
func (*Stats) TotalLLMReqTokens ¶
TotalLLMReqTokens calculates the total LLM request tokens.
func (*Stats) TotalLLMRequests ¶
TotalLLMRequests returns a copy of the total LLM requests durations.
func (*Stats) TotalLLMRespBytes ¶
TotalLLMRespBytes calculates the total LLM response bytes.
func (*Stats) TotalLLMRespTokens ¶
TotalLLMRespTokens calculates the total LLM response tokens.
func (*Stats) TotalLLMTokens ¶
TotalLLMTokens calculates the total LLM tokens (request + response).
type Writer ¶
Writer writes Stats to a prarticular output.
func NewCSVWriter ¶
NewCSVWriter created an instance of StatsWriter that saves statistics in CSV format.
func NewStdWriter ¶
NewStdWriter creates an instance of StatsWriter that prints statistics to the stdout.