Socket
Book a DemoInstallSign in
Socket

ah-stats-plugin

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ah-stats-plugin

I collect, store, and fetch stats about your actionhero cluster

latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

ah-stats-plugin

These methods were removed from the actionHero core for v12, on September 12th, 2015

This plugin creates methods for you to store arbitrary statistics about your server. These stats are stored in Redis, and are shared throughout the cluster.

Stats are buffered locally in each induvidual server for a period of time, and then periodically flushed to redis. You can control these settings via ./config/stats.js

An example stats action is provided which will list back all the stats stored in your cluster, along with metadata about the task system and server.

Install

  • npm install --save ah-stats-plugin
  • in ./config/plugins.js, denote the plugin as active:
exports['default'] = {
  general: function(api){
    return {
      plugins: [ 'ah-stats-plugin' ]
    };
  }
};

Stats

api.stats.increment(key, count)

  • key is a string of the form ("thing:stuff")
  • count is a signed integer (can be negative)

api.stats.get(key, collection, next)

  • next(err, data)
  • key is a string of the form ("thing:stuff")
  • collection (optional) is one of the collections used for stats set in api.config.stats.keys

api.stats.getAll(collections, next)

  • next(err, stats)
  • collections (optional) is an array of one or more of the keys used for stats set in api.config.stats.keys
  • stats is a hash of {key1: stats {}, key2: stats {} }
  • keys will be collapsed into a hash

Keywords

actionhero

FAQs

Package last updated on 12 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts