TopEventsJob

TopEventsJob

Class for job of top events widget

Constructor

new TopEventsJob()

Source:

Members

(static) COLLECTION_NAME

Description:
  • TopEvents collection name.

Source:
Properties:
Type Description
string

TopEvents collection name.

(static) PERIODS

Description:
  • Events periods.

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

Events periods.

Methods

encodeEvents(data) → {Object}

Description:
  • Encode event name.

Source:
Parameters:
Name Type Description
data Object

event data.

Returns:

encoded data.

Type
Object

eventsCollentions(params) → {string}

Description:
  • Events collections.

Source:
Parameters:
Name Type Description
params Object

event, id.

Returns:

event collection.

Type
string

eventsFilter(eventsData) → {array}

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

Source:
Parameters:
Name Type Description
eventsData array

events list.

Returns:

filtered data.

Type
array

(async) fetchEventTotalCounts(params, data, previous) → {Promise}

Source:
Parameters:
Name Type Description
params object

params object

data object

object where to collect data

previous boolean

if fetching for previous period

Returns:

promise

Type
Promise

(async) getAllApps()

Description:
  • 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.

Source:

(async) getAppEvents(app)

Description:
  • async getAppEvents function

Source:
Parameters:
Name Type Description
app Object

saveAppEvents object

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

Description:
  • async Get total sessions.

Source:
Parameters:
Name Type Description
params Object

getSessionsCount object

Properties
Name Type Description
usersCollectionName String

users collection name

ob Object

it contains all necessary info

sessionData Object

dummy session data

usersData Object

dummy users data

Returns:

true.

Type
Promise.<boolean>

(async) init()

Description:
  • TopEvents initialize function

Source:

mutatePeriod(period) → {String}

Description:
  • mutatePeriod function

Source:
Parameters:
Name Type Description
period String

30days, hour

Returns:
  • period
Type
String

(async) run(db, done)

Description:
  • Run the job

Source:
Parameters:
Name Type Description
db Db

connection

done done

callback

(async) saveAppEvents(params)

Description:
  • async saveAppEvents function

Source:
Parameters:
Name Type Description
params Object

saveAppEvents object

timeSecond() → {Number}

Description:
  • timeSecond function

Source:
Returns:
  • timesecond
Type
Number