TopEventsJob

TopEventsJob

Class for job of top events widget

Constructor

new TopEventsJob()

Source:

Members

(static) COLLECTION_NAME

Source:
Properties:
Type Description
string

TopEvents collection name.

(static) PERIODS

Source:
Properties:
Name Type Attributes Description
"30days", "hour", "month", "60days", "yesterday", "7days" array <optional>

Events periods.

(static) TOTAL_EVENT_COUNT

Source:
Properties:
Type Description
number

The total count of events for calculating TopEvents widget must be 5 or more.

Methods

encodeEvents(data) → {Object}

Source:

Encode event name.

Parameters:
Name Type Description
data Object

event data.

Returns:

encoded data.

Type
Object

eventsCollentions(params) → {string}

Source:

Events collections.

Parameters:
Name Type Description
params Object

event, id.

Returns:

event collection.

Type
string

eventsFilter(eventsData) → {array}

Source:

If the event's name include [CLY], removed them.

Parameters:
Name Type Description
eventsData array

events list.

Returns:

filtered data.

Type
array

(async) getAllApps()

Source:

async That initialize function for TopEvents Job but Its main purpose is to get all the Apps. The errors of all functions will be caught here.

(async) getAppEvents(app)

Source:

async getAppEvents function

Parameters:
Name Type Description
app Object

saveAppEvents object

(async) getEventsCount(params) → {Promise.<boolean>}

Source:

async Get events count.

Parameters:
Name Type Description
params Object

getEventsCount object

Properties
Name Type Description
collectionNameEvents String

event collection name

ob Object

it contains all necessary info

event string

event name

data Object

dummy event data

Returns:

true.

Type
Promise.<boolean>

init()

Source:

TopEvents initialize function

mutatePeriod(period) → {String}

Source:

mutatePeriod function

Parameters:
Name Type Description
period String

30days, hour

Returns:
  • period
Type
String

run(db, done)

Source:

Run the job

Parameters:
Name Type Description
db Db

connection

done done

callback

(async) saveAppEvents(params)

Source:

async saveAppEvents function

Parameters:
Name Type Description
params Object

saveAppEvents object

timeSecond() → {Number}

Source:

timeSecond function

Returns:
  • timesecond
Type
Number