Git Product home page Git Product logo

iflux-metrics-action-target's Introduction

iflux-metrics-action-target

An action target that provides a simple analytics service (aggregates)

Development setup

Create a .env file in the root directory of the project and put the following content:

METRICS_ACTION_TYPE=http://localhost:3000/schemas/actionTypes/updateMetric

#####################################################################################################
# ONLY USED IN MODE WHERE IFLUX IS LOCALLY DEPLOYED AND MONGODB IS USED WITH DOCKER
#####################################################################################################
# MongoDB
MONGODB_HOST=<Boot2Docker IP>
MONGODB_PORT=27017

Mandatory

Name Description
METRICS_ACTION_TYPE Define the metrics action type. Must be unique.

Optional

If you are using Docker you may have to configure this MongoDB info. Otherwise, it is supposed to have a local installation of MongoDB automatically configured to localhost:27017

Name Description
MONGODB_HOST Should be the Docker host IP (boot2docker IP, Vagrant VM IP, ...)
MONGODB_PORT Default port is 27017.

iflux-metrics-action-target's People

Contributors

guytomoki avatar prevole avatar wasadigi avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

guytomoki

iflux-metrics-action-target's Issues

GET minutely returns an empty array

When I do a GET /metrics/:metric/minutely/2015-07-10T13:58:00Z, I receive an empty array although the GET /metrics/:metric/hourly/2015-07-10T13:58:00Z tells me that there should be some measures:

[
  {
    "header": {
      "metric": "myMetric",
      "facet": "hourly",
      "startDate": "2015-07-10T13:00:00.000Z",
      "endDate": "2015-07-10T13:59:59.999Z",
      "timeZone": "Europe/Zurich"
    },
    "lastMeasure": {
      "metric": "myMetric",
      "value": 98,
      "timestamp": "2015-07-10T13:58:48Z"
    },
    "minutely": {
      "13": {
        "count": 2,
        "sum": 198,
        "min": 99,
        "max": 99
      },
      "15": {
        "count": 1,
        "sum": 99,
        "min": 99,
        "max": 99
      },
      "17": {
        "count": 1,
        "sum": 99,
        "min": 99,
        "max": 99
      },
      "18": {
        "count": 1,
        "sum": 99,
        "min": 99,
        "max": 99
      },
      "19": {
        "count": 1,
        "sum": 99,
        "min": 99,
        "max": 99
      },
      "21": {
        "count": 2,
        "sum": 176,
        "min": 77,
        "max": 99
      },
      "22": {
        "count": 3,
        "sum": 258,
        "min": 77,
        "max": 99
      },
      "31": {
        "count": 2,
        "sum": 197,
        "min": 98,
        "max": 99
      },
      "42": {
        "count": 2,
        "sum": 196,
        "min": 98,
        "max": 98
      },
      "48": {
        "count": 1,
        "sum": 98,
        "min": 98,
        "max": 98
      },
      "50": {
        "count": 23,
        "sum": 2360,
        "min": 98,
        "max": 201
      },
      "51": {
        "count": 4,
        "sum": 498,
        "min": 98,
        "max": 201
      },
      "56": {
        "count": 4,
        "sum": 498,
        "min": 98,
        "max": 201
      },
      "58": {
        "count": 20,
        "sum": 2490,
        "min": 98,
        "max": 201
      }
    },
    "last5Measures": [
      {
        "metric": "myMetric",
        "value": 98,
        "timestamp": "2015-07-10T13:58:47Z"
      },
      {
        "metric": "myMetric",
        "value": 201,
        "timestamp": "2015-07-10T13:58:49Z"
      },
      {
        "metric": "myMetric",
        "value": 100,
        "timestamp": "2015-07-10T13:58:48Z"
      },
      {
        "metric": "myMetric",
        "value": 99,
        "timestamp": "2015-07-10T13:58:48Z"
      },
      {
        "metric": "myMetric",
        "value": 98,
        "timestamp": "2015-07-10T13:58:48Z"
      }
    ]
  }
]

Add milliseconds to timestamps

Milliseconds should be included in the timestamps of lastMeasure and last5Measures, such as in the startDate and endDate:

[
  {
    "header": {
      ...,
      "startDate": "2015-07-21T09:00:00.000Z",
      "endDate": "2015-07-21T09:59:59.999Z",
      ...
    },
    "lastMeasure": {
      ...,
      "timestamp": "2015-07-21T09:09:24Z"
    },
    "minutely": {
      ...
    },
    "last5Measures": [
      {
        ...,
        "timestamp": "2015-07-21T09:09:22Z"
      },
      ...
    ]
  }
]

GET daily should return hourly data in UTC

As you can see in the below example, "header", "lastMeasure" and "last5Measures" give timestamps in UTC wheareas "hourly" gives data in UTC+2

[
  {
    "header": {
      "metric": "myMetric",
      "facet": "daily",
      "startDate": "2015-07-09T22:00:00.000Z",
      "endDate": "2015-07-10T21:59:59.999Z",
      "timeZone": "Europe/Zurich"
    },
    "lastMeasure": {
      "metric": "myMetric",
      "value": 86,
      "timestamp": "2015-07-10T20:35:28Z"
    },
    "hourly": {
      "12": {
        "count": 4,
        "sum": 378,
        "min": 81,
        "max": 99
      },
      "14": {
        "count": 5,
        "sum": 495,
        "min": 99,
        "max": 99
      },
      "15": {
        "count": 67,
        "sum": 7365,
        "min": 77,
        "max": 201
      },
      "16": {
        "count": 2,
        "sum": 164,
        "min": 82,
        "max": 82
      },
      "22": {
        "count": 2,
        "sum": 168,
        "min": 82,
        "max": 86
      }
    },
    "last5Measures": [
      {
        "metric": "myMetric",
        "value": 98,
        "timestamp": "2015-07-10T13:58:48Z"
      },
      {
        "metric": "myMetric",
        "value": 82,
        "timestamp": "2015-07-10T14:01:48Z"
      },
      {
        "metric": "myMetric",
        "value": 82,
        "timestamp": "2015-07-10T14:01:55Z"
      },
      {
        "metric": "myMetric",
        "value": 82,
        "timestamp": "2015-07-10T20:35:23Z"
      },
      {
        "metric": "myMetric",
        "value": 86,
        "timestamp": "2015-07-10T20:35:28Z"
      }
    ]
  }
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.