Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exporter ¶
type Exporter struct { WebConfig string ListenAddress string MetricsPath string Logger log.Logger model.TimeEntryRepository model.ProjectRepository // contains filtered or unexported fields }
Exporter collects Toggl stats from toggl API Response and exports them using the prometheus metrics package.
func (*Exporter) Collect ¶
func (e *Exporter) Collect(ch chan<- prometheus.Metric)
Collect fetches the stats from Toggl API Responce and delivers them as Prometheus metrics. It implements prometheus.Collector.
func (*Exporter) Describe ¶
func (e *Exporter) Describe(ch chan<- *prometheus.Desc)
Describe describes all the metrics ever exported by the toggl exporter. It implements prometheus.Collector.
func (*Exporter) GetProjectDurations ¶
func (e *Exporter) GetProjectDurations(ctx context.Context) ([]ProjectTimeDuration, error)
GetProjectDurations get time entries and calculate sum of time grouped by the project.
func (*Exporter) ListenAndServe ¶
ListenAndServe listens on the TCP network address congured address and then calls Serve to handle requests on incoming connections.
Click to show internal directories.
Click to hide internal directories.