1.5.0 • Published 6 years ago

@fabrix/spool-analytics v1.5.0

Weekly downloads
15
License
MIT
Repository
github
Last release
6 years ago

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

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.1.0-alpha.1

6 years ago