Skip to content

Instantly share code, notes, and snippets.

@scr512
Last active August 2, 2016 20:47
Show Gist options
  • Save scr512/f6010726739a23b1662d to your computer and use it in GitHub Desktop.
Save scr512/f6010726739a23b1662d to your computer and use it in GitHub Desktop.
Cyclotron (https://github.com/ExpediaInceCommercePlatform/cyclotron) Table Dashboard example consuming SyncIQ policy reporting and calculating lag time.
{
"dataSources": [{
"name": "Your Isilon Cluster SyncIQ Report",
"options": {
"auth": {
"pass": "<password>",
"user": "<username>"
},
"strictSSL": false
},
"postProcessor": "pp = function (data) {\n\n var new_data = _.map(data.reports, function(row) {\n \n return {\n name: row.policy.name,\n state: row.state,\n start_time: row.start_time,\n end_time: row.end_time,\n duration: row.duration,\n };\n });\n\n return _.compact(new_data);\n}",
"refresh": 300,
"sortBy": [],
"type": "json",
"url": "https://isilon.local/platform/1/sync/reports?reports_per_policy=1"
}],
"description": "SyncIQ Report",
"name": "synciq-reports",
"pages": [{
"frequency": 600,
"layout": {
"gridColumns": 1,
"gridRows": 1
},
"name": "Your Isilon Cluster",
"theme": "gto",
"widgets": [{
"columns": [{
"label": "Name",
"name": "name"
}, {
"name": "state"
}, {
"name": "start_time",
"text": "${moment.unix(#{start_time}).format('DD-MM-YYYY HH:mm')}"
}, {
"name": "end_time",
"text": "${moment.unix(#{end_time}).format('DD-MM-YYYY HH:mm')}"
}, {
"name": "duration",
"text": "${moment('2000-01-01 00:00:00').add(moment.duration(#{duration} * 1000)).format('HH:mm:ss')}"
}, {
"label": "Lag time",
"name": "",
"text": "${moment.unix(#{start_time}).fromNow()}"
}],
"dataSource": "Your Isilon Cluster SyncIQ Report",
"enableSort": true,
"freezeHeaders": true,
"noscroll": true,
"pagination": {
"autoItemsPerPage": false,
"enabled": false,
"itemsPerPage": 25
},
"rules": [{
"background-color": "#B2EC5D",
"columns": ["state"],
"rule": "!_.isNull('#{state}'.match(/finished.*/gi))"
}, {
"background-color": "#FF3333",
"columns": ["state"],
"rule": "!_.isNull('#{state}'.match(/failed.*/gi))"
}, {
"background-color": "#3399ff",
"columns": ["state"],
"rule": "!_.isNull('#{state}'.match(/running.*/gi))"
}, {
"background-color": "#ff9933",
"columns": ["state"],
"rule": "!_.isNull('#{state}'.match(/needs.*/gi))"
}],
"sortBy": ["state"],
"title": "Your Isilon Cluster",
"widget": "table"
}]
}],
"parameters": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment