@fabrix/spool-analytics
TypeScript icon, indicating that this package has built-in type declarations

1.5.0 • Public • Published

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'
    ]
  }
}

Dependents (0)

Package Sidebar

Install

npm i @fabrix/spool-analytics

Homepage

fabrix.app

Weekly Downloads

28

Version

1.5.0

License

MIT

Unpacked Size

40.3 kB

Total Files

57

Last publish

Collaborators

  • scottbwyatt