diff

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetElasticSearchParams

func GetElasticSearchParams(accountList []string, durationBegin time.Time,
	durationEnd time.Time, aggregationPeriod string, client *elastic.Client, index string) *elastic.SearchService

GetElasticSearchParams is used to construct an ElasticSearch *elastic.SearchService used to retrieve the cost by usageType for each week/month in the time range It takes as paramters :

  • accountList []string : A slice of string representing aws account number, in the format of the field 'awsdetailedlineitem.linked_account_id'
  • durationBeing time.Time : A time.Time struct representing the begining of the time range in the query
  • durationEnd time.Time : A time.Time struct representing the end of the time range in the query
  • client *elastic.Client : an instance of *elastic.Client that represent an Elastic Search client.
  • index string : The Elastic Search index on wich to execute the query. In this context the default value should be "awsdetailedlineitems"

This function excepts arguments passed to it to be sanitize. If they are not, the following cases will make it crash :

  • If the client is nil or malconfigured, it will crash
  • If the index is not an index present in the ES, it will crash

func TaskDiffData

func TaskDiffData(ctx context.Context, aa aws.AwsAccount, date time.Time) (data costDiff, err error)

TaskDiffData prepares an elasticsearch query and retrieves cost differentiator data

Types

type PricePoint

type PricePoint struct {
	Date             string
	Cost             float64
	PercentVariation float64
}

PricePoint struct stores elements for cost differentiator

Jump to

Keyboard shortcuts

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