1.1.4 • Published 4 years ago

sd-report v1.1.4

Weekly downloads
2
License
MIT
Repository
-
Last release
4 years ago

sd-report

a reporter for nodejs environment

Installation

$ npm install sd-report -S

or

$ yarn add sd-report

In Node.js:

const createReporters = require('sd-report')

const influxConfig = {
  app: 'your project name',
  address: 'your influxdb address',
  types: {
    access: {
      measurement: 'access',
      fieldSchema: {
        count: 'i',
        process_time: 'i'
      },
      tagSchema: {
        metric_type: '*',
        app: '*',
        host: '*',
        request_method: '*',
        response_status: '*',
        module_name: '*'
      }
    },

    error: {
      measurement: 'error',
      fieldSchema: {
        count: 'i'
      },
      tagSchema: {
        metric_type: '*',
        app: '*',
        host: '*',
        exception_type: '*'
      }
    },

    memory: {
      measurement: 'memory',
      fieldSchema: {
        rss: 'i',
        heapTotal: 'i',
        heapUsed: 'i',
        external: 'i'
      },
      tagSchema: {
        metric_type: '*',
        app: '*',
        host: '*'
      }
    }
  }
}

const { reportAccess, reportError, reportMemory } = createReporters(influxConfig)

// report the memory info
setInterval(() => {
  reportMemory(process.memoryUsage())
}, 60000)
1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

5 years ago

1.0.1

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago