stats

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package stats provides functionality for basic usage statistics in Goophry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stats

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

Stats provides routines to gather basic statistics and serve them through a HTTP-server.

func NewStats

func NewStats() Stats

NewStats returns a new instance of Stats.

func (*Stats) IncrTaskCount

func (s *Stats) IncrTaskCount(task string)

IncrTaskCount increments the counter of a certain task.

func (*Stats) InitTask

func (s *Stats) InitTask(task string)

InitTask initialises the task-counter for a certain task. The counter should be initialised so that it will be returned in the HTTP response, even when it is 0.

func (Stats) ServeHttp

func (s Stats) ServeHttp(iface string, pattern string) error

ServeHttp spawns an HTTP-server, that responds with a statsResponse in JSON.

func (Stats) ServeHttps

func (s Stats) ServeHttps(iface string, pattern string, cert string, key string) error

ServeHttps spawns an HTTP-server, that responds with a statsResponse in JSON, expecting HTTPS connections.

func (*Stats) SetVersion

func (s *Stats) SetVersion(version string)

SetVersion updates the version-number of the Goophry application.

Jump to

Keyboard shortcuts

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