Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
},
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
}
]
$('#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);
};