consumptions

package
v0.0.0-...-2f4e5d5 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveConsumptions

func SaveConsumptions(settings AzureStorageSettings, consumptions WebsiteConsumptions, serverName string) error

SaveConsumptions saves report to azure storage table

Types

type AzureStorageSettings

type AzureStorageSettings struct {
	AccountName       string
	Key               string
	TableNameTemplate string
}

AzureStorageSettings contains information necessary to save consumption information into Azure Storage tables

type ConsumptionRecord

type ConsumptionRecord struct {
	WebsiteID    int
	Time         time.Time
	FilesCount   int
	Files        int64
	Dynamic      int64
	DynamicCount int
	Other        int64
	OtherCount   int
}

ConsumptionRecord contains information about traffic consumption of a website

type UnknownDomainsCounter

type UnknownDomainsCounter struct {
	Domain    string
	Requested int
}

UnknownDomainsCounter contains information about domains unknown to the system and number of times they were requested

type UsagesCollection

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

UsagesCollection contains methods to calculate traffic stats from log records

func NewUsagesCollection

func NewUsagesCollection(domains map[string]*websites.WebsiteInfo) *UsagesCollection

NewUsagesCollection creates instance of UsagesCollection

func (*UsagesCollection) AddRecord

func (usages *UsagesCollection) AddRecord(record *logsreader.LogRecord)

AddRecord adds log record to UsagesCollection

func (*UsagesCollection) GetTrafficConsumption

func (usages *UsagesCollection) GetTrafficConsumption() WebsiteConsumptions

GetTrafficConsumption returns traffic consumptions of currently added log records

func (*UsagesCollection) GetUnknownDomains

func (usages *UsagesCollection) GetUnknownDomains() []UnknownDomainsCounter

GetUnknownDomains return list of unknown domains found in log records

type WebsiteConsumptions

type WebsiteConsumptions map[int][]*ConsumptionRecord

WebsiteConsumptions contains consumption records of the website for all the period

Jump to

Keyboard shortcuts

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