Skip to content

Latest commit

 

History

History
53 lines (44 loc) · 3.18 KB

traffic_stats.rst

File metadata and controls

53 lines (44 loc) · 3.18 KB

Traffic Stats

Introduction

Traffic Stats is a utility written in Go that is used to acquire and store statistics about CDNs controlled by Traffic Control. Traffic Stats mines metrics from the :ref:`tm-api` and stores the data in InfluxDB. Data is typically stored in InfluxDB on a short-term basis (30 days or less) and is used to drive graphs created by Grafana which are linked from Traffic Ops. Traffic Stats also calculates daily statistics from InfluxDb and stores them in the Traffic Ops database.

Software Requirements

Traffic Stats Project Tree Overview

Go Formatting Conventions

In general Go fmt is the standard for formatting Go code. It is also recommended to use Go lint.

Installing The Developer Environment

  1. Clone the traffic_control repository using Git into a location accessible by your $GOPATH
  2. Navigate to the :atc-file:`traffic_ops/v4-client` directory of your cloned repository. (This is the directory containing Traffic Ops client code used by Traffic Stats)
  3. From the :atc-file:`traffic_ops/v4-client` directory, run go test to test the client code. This will run all unit tests for the client and return the results. If there are missing dependencies you will need to run go mod vendor -v to get the dependencies
  4. Once the tests pass, run go install to build and install the Traffic Ops client package. This makes it accessible to Traffic Stats.
  5. Navigate to your cloned repository under Traffic Stats
  6. Run go build traffic_stats.go to build traffic_stats. You will need to run go mod vendor -v for any missing dependencies.