heatmap

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeatmapData

type HeatmapData struct {
	TotalTokens int              `json:"total_tokens"`
	Sections    []HeatmapSection `json:"sections"`
	WasteScore  float64          `json:"waste_score"`
	Timestamp   int64            `json:"timestamp"`
}

type HeatmapGenerator

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

func NewHeatmapGenerator

func NewHeatmapGenerator() *HeatmapGenerator

func (*HeatmapGenerator) Generate

func (g *HeatmapGenerator) Generate(input string) *HeatmapData

func (*HeatmapGenerator) GenerateWithWaste

func (g *HeatmapGenerator) GenerateWithWaste(input string, wasteScore float64) *HeatmapData

func (*HeatmapGenerator) Summary

func (g *HeatmapGenerator) Summary(data *HeatmapData) string

func (*HeatmapGenerator) ToCSV

func (g *HeatmapGenerator) ToCSV(data *HeatmapData) string

func (*HeatmapGenerator) ToJSON

func (g *HeatmapGenerator) ToJSON(data *HeatmapData) ([]byte, error)

type HeatmapRecord

type HeatmapRecord struct {
	ID          int64     `json:"id"`
	RequestID   string    `json:"request_id"`
	TotalTokens int       `json:"total_tokens"`
	WasteScore  float64   `json:"waste_score"`
	SystemPct   float64   `json:"system_pct"`
	ToolsPct    float64   `json:"tools_pct"`
	ContextPct  float64   `json:"context_pct"`
	HistoryPct  float64   `json:"history_pct"`
	QueryPct    float64   `json:"query_pct"`
	CreatedAt   time.Time `json:"created_at"`
}

type HeatmapSection

type HeatmapSection struct {
	Type       SectionType `json:"type"`
	TokenCount int         `json:"token_count"`
	Percentage float64     `json:"percentage"`
	StartLine  int         `json:"start_line"`
	EndLine    int         `json:"end_line"`
	Content    string      `json:"content,omitempty"`
}

type HeatmapStore

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

func NewHeatmapStore

func NewHeatmapStore(db *sql.DB) *HeatmapStore

func (*HeatmapStore) ExportCSV

func (s *HeatmapStore) ExportCSV() string

func (*HeatmapStore) ExportJSON

func (s *HeatmapStore) ExportJSON() ([]byte, error)

func (*HeatmapStore) GetAverages

func (s *HeatmapStore) GetAverages(days int) (map[string]float64, error)

func (*HeatmapStore) GetRecent

func (s *HeatmapStore) GetRecent(limit int) ([]HeatmapRecord, error)

func (*HeatmapStore) Init

func (s *HeatmapStore) Init() error

func (*HeatmapStore) Record

func (s *HeatmapStore) Record(data *HeatmapData, requestID string) error

type SectionAnalyzer

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

func NewSectionAnalyzer

func NewSectionAnalyzer() *SectionAnalyzer

func (*SectionAnalyzer) Analyze

func (a *SectionAnalyzer) Analyze(input string) []HeatmapSection

func (*SectionAnalyzer) ClassifyLine

func (a *SectionAnalyzer) ClassifyLine(line string) SectionType

type SectionType

type SectionType string
const (
	SectionSystem  SectionType = "system"
	SectionTools   SectionType = "tools"
	SectionContext SectionType = "context"
	SectionHistory SectionType = "history"
	SectionQuery   SectionType = "query"
	SectionOutput  SectionType = "output"
	SectionUnknown SectionType = "unknown"
)

Jump to

Keyboard shortcuts

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