@fabrix/spool-analytics

Spool: Analytics for Fabrix

Stats

StarsIssuesVersionUpdatedCreatedSize
@fabrix/spool-analytics
301.5.03 years ago3 years agoMinified + gzip package size for @fabrix/spool-analytics in KB

Readme

spool-analytics

Gitter NPM version Build Status Test Coverage Dependency Status Follow @FabrixApp on Twitter

Analytics for Fabrix Apps.

Take a snap shot of a data set for later analysis.

Install

$ npm install --save @fabrix/spool-analytics

Configure

Add the spool

// config/main.js
import { AnalyticsSpool } from '@fabrix/spool-analytics'
import { CronsSpool } from '@fabrix/spool-crons'

export const main = {
  spools: [
    // ... other spools
    CronsSpool,
    AnalyticsSpool
  ]
}

Configure Analytics

// config/analytics.ts
export const analytics = {
   prefix: '/api/v1',
   profile: 'testProfile',
   config: {
     profiles: {
       testProfile: [
         'TestAnalytic.test',
         'TestAnalytic.minuteTest',
         'TestAnalytic.hourTest',
         'TestAnalytic.dayTest',
         'TestAnalytic.weekTest',
         'TestAnalytic.monthTest',
         'TestAnalytic.quarterTest',
         'TestAnalytic.yearTest'
       ]
     },
     frequency: {
       minute: [
         'TestAnalytic.minuteTest'
       ],
       hour: [
         'TestAnalytic.hourTest'
       ],
       day: [
         'TestAnalytic.dayTest'
       ],
       week: [
         'TestAnalytic.weekTest'
       ],
       month: [
         'TestAnalytic.monthTest'
       ],
       quarter: [
         'TestAnalytic.quarterTest'
       ],
       year: [
         'TestAnalytic.yearTest'
       ]
     }
   }
 }
               

Configure the crons spool to run the analytic crons

// config/crons.ts
export const crons = {
  prefix: '/api/v1',
  live_mode: false,
  profile: 'testProfile',
  profiles: {
    testProfile: [
      'AnalyticsCron.minute',
      'AnalyticsCron.hour',
      'AnalyticsCron.day',
      'AnalyticsCron.week',
      'AnalyticsCron.month',
      'AnalyticsCron.quarter',
      'AnalyticsCron.year'
    ]
  }
}

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.