How to use the keen-analysis.Query function in keen-analysis

To help you get started, we’ve selected a few keen-analysis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chronologic / eth-alarm-clock-dapp / app / stores / KeenStore.js View on Github external
async _getActiveTimeNodesHistory() {
    await this.initialized;

    if (!this.isBlacklisted) {
      const count = new KeenAnalysis.Query('count_unique', {
        event_collection: COLLECTIONS.TIMENODES,
        target_property: 'nodeAddress',
        timeframe: {
          start: moment()
            .subtract(24, 'hours')
            .toISOString(),
          end: moment().toISOString()
        },
        interval: 'hourly',
        group_by: 'nodeAddress',
        filters: [
          {
            property_name: 'networkId',
            operator: 'eq',
            property_value: this.timeNodeSpecificProviderNetId
          },
github chronologic / eth-alarm-clock-dapp / app / stores / KeenStore.js View on Github external
async getActiveTimeNodesCount(networkId, timeframe = 'this_5_minutes') {
    await this.initialized;

    if (!this.isBlacklisted) {
      const count = new KeenAnalysis.Query('count', {
        event_collection: COLLECTIONS.TIMENODES,
        target_property: 'nodeAddress',
        timeframe,
        group_by: 'nodeAddress',
        filters: [
          {
            property_name: 'networkId',
            operator: 'eq',
            property_value: networkId
          },
          {
            property_name: 'eacVersions.contracts',
            operator: 'eq',
            property_value: this.versions.contracts
          }
        ]
github CenterForOpenScience / osf.io / admin / static / js / pages / metrics-page.js View on Github external
$('#preprints-range')[0].onclick = function() {
        var preprint_created = new keenAnalysis.Query('sum', {
            eventCollection: 'preprint_summary',
            targetProperty: 'provider.total',
            groupBy: ['provider.name'],
            interval: 'daily',
            timeframe: {
                'start': $('#start-date')[0].value,
                'end': $('#end-date')[0].value
            },
            timezone: "UTC"
        });

        Metrics.KeenRenderMetrics("#preprints-added", "line", preprint_created, 200);
    };

keen-analysis

A JavaScript client for Keen.IO

MIT
Latest version published 4 years ago

Package Health Score

51 / 100
Full package analysis