Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FH-3785 Add sync stats endpoint #5

Merged

Conversation

aidenkeating
Copy link
Contributor

  • Add /sys/info/stats endpoint that invokes sync.getStats()
  • Add default server port, 3000

* Add /sys/info/stats endpoint that invokes sync.getStats()
* Add default server port, 3000
@aidenkeating
Copy link
Contributor Author

@david-martin Would you mind taking a look? This is adding the stats endpoint to be used in the MCP.

At the moment the response before an initial sync (before the redis client is initialised) can be quite messy, so this PR will include a bump to use feedhenry/fh-sync#33 when it's merged.

The current response from fh-sync-js has a lot going on.

An example of what the response looks like currently:

{
  "CPU usage": {
    "message": "no stats available"
  },
  "RSS Memory Usage": {
    "master": {
      "current": "62.04MB",
      "max": "79.25MB",
      "min": "47.55MB",
      "average": "53.49MB",
      "numberOfRecords": 832,
      "from": "2017-08-16T09:01:10.157Z",
      "end": "2017-08-16T10:24:38.534Z"
    }
  },
  "Job Process Time": {
    "sync_worker": {
      "current": "18.00ms",
      "max": "36.00ms",
      "min": "6.00ms",
      "average": "9.26ms",
      "numberOfRecords": 384,
      "from": "2017-08-16T09:01:05.504Z",
      "end": "2017-08-16T11:02:28.078Z"
    },
    "pending_worker": {
      "current": "49.00ms",
      "max": "49.00ms",
      "min": "3.00ms",
      "average": "22.67ms",
      "numberOfRecords": 3,
      "from": "2017-08-16T09:01:05.466Z",
      "end": "2017-08-16T11:02:28.043Z"
    },
    "ack_worker": {
      "current": "2.00ms",
      "max": "2.00ms",
      "min": "1.00ms",
      "average": "1.50ms",
      "numberOfRecords": 4,
      "from": "2017-08-16T09:01:38.262Z",
      "end": "2017-08-16T09:03:52.108Z"
    }
  },
  "Job Queue Size": {
    "ack_worker": {
      "current": 0,
      "max": 0,
      "min": 0,
      "average": 0,
      "numberOfRecords": 333,
      "from": "2017-08-16T09:56:17.502Z",
      "end": "2017-08-16T10:24:38.566Z"
    },
    "pending_worker": {
      "current": 0,
      "max": 0,
      "min": 0,
      "average": 0,
      "numberOfRecords": 333,
      "from": "2017-08-16T09:56:17.501Z",
      "end": "2017-08-16T10:24:38.565Z"
    },
    "sync_worker": {
      "current": 1,
      "max": 1,
      "min": 0,
      "average": 0.059880239520958,
      "numberOfRecords": 334,
      "from": "2017-08-16T09:56:12.502Z",
      "end": "2017-08-16T10:24:38.564Z"
    }
  },
  "API Process Time": {
    "message": "no stats available"
  },
  "Mongodb Operation Time": {
    "message": "no stats available"
  }
}

@david-martin david-martin merged commit a4bd2d0 into feedhenry:master Aug 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants