This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=1920, height=1080" /> | |
| <title>HeyGen — AI Video Intro</title> | |
| <link rel="preconnect" href="https://fonts.googleapis.com" /> | |
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> | |
| <link | |
| href="https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500&display=block" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=1920, height=1080" /> | |
| <title>HeyGen — AI Video for India</title> | |
| <link rel="preconnect" href="https://fonts.googleapis.com" /> | |
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> | |
| <!-- | |
| Noto Sans family covers all Indic scripts cleanly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \b[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,63}\b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})?\.com\/?[a-zA-Z0-9]{0,}((https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})?\.com)?|(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})?\.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Excel = require("exceljs"); | |
| generateWorkBook = (res, workBookDatas) => { | |
| var workbook = new Excel.Workbook(); | |
| /** CPU Usage Sheet */ | |
| var cpuUsageSheet = workbook.addWorksheet('CPU USAGE'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { InfluxDB, flux } = require("@influxdata/influxdb-client"); | |
| const { url, token, org, bucket, timeout } = require("./env"); | |
| getCPUUsage = async (startDuration, endDuration) => { | |
| const queryApi = new InfluxDB({ url, token, timeout }).getQueryApi(org); | |
| const fluxQuery = flux`from(bucket:"${bucket}") |> range(start: ${startDuration}, stop: ${endDuration}) |> filter(fn: (r) => r._measurement == "cpu") |> filter(fn: (r) => r._field == "usage_user" or r._field == "usage_system" or r._field == "usage_idle") |> filter(fn: (r) => r.cpu == "cpu-total") |> aggregateWindow(every: 1h, fn: last, createEmpty: false) |> last()`; | |
| const cpuUsageJSON = []; | |
| await queryApi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** InfluxDB v2 URL */ | |
| const url = 'http://localhost:8086/' | |
| /** InfluxDB authorization token - Get all access token */ | |
| const token = '' | |
| /** Organization within InfluxDB */ | |
| const org = '' | |
| /**InfluxDB bucket used in examples */ | |
| const bucket = '' | |
| const timeout = 500000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express'); | |
| const moment = require('moment'); | |
| const momentGrafana = require('moment-relativism'); | |
| const { fluxDuration } = require("@influxdata/influxdb-client"); | |
| const { METRIC_HEADERS } = require('./constants'); | |
| const { getCPUUsage } = require("./cpuUsage"); | |
| const { generateWorkBook } = require("./generateWorkBook"); | |
| const app = express(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const METRIC_HEADERS = [ | |
| { header: "Time", key: "time", width: 32 }, | |
| { header: "Host name", key: "host", width: 32 }, | |
| { header: "Measurement", key: "measurement", width: 32 }, | |
| { header: "Usage", key: "usage", width: 32 }, | |
| ]; | |
| module.exports = { | |
| METRIC_HEADERS, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "annotations": { | |
| "list": [ | |
| { | |
| "builtIn": 1, | |
| "datasource": "-- Grafana --", | |
| "enable": true, | |
| "hide": true, | |
| "iconColor": "rgba(0, 211, 255, 1)", | |
| "name": "Annotations & Alerts", |
NewerOlder