How to use pollInterval method in Puppeteer

Best JavaScript code snippet using puppeteer

index.js

Source:index.js Github

copy

Full Screen

1import React from 'react';2import MovingAverage from '../../components/MovingAverage';3import {4 NrqlQuery,5 LineChart,6 Grid,7 GridItem,8 PlatformStateContext,9 ChartGroup10} from 'nr1';11import { timeRangeToNrql } from '@newrelic/nr1-community';12export default class MovingAverageNerdletNerdlet extends React.Component {13 render() {14 const accountId = 1; //set this to your account id15 const pollInterval = 60000;16 return (17 <div className="demo">18 <PlatformStateContext.Consumer>19 {platformState => {20 const sinceClause = ` ${timeRangeToNrql(platformState)}`;21 return (22 <ChartGroup>23 <Grid>24 <GridItem columnSpan={4}>25 <h2>Declarative example</h2>26 <NrqlQuery27 pollInterval={pollInterval}28 accountId={accountId}29 query={`SELECT average(duration) as 'Duration' from Transaction timeseries max${sinceClause}`}30 >31 {({ data }) => {32 return (33 <>34 <MovingAverage35 window={10}36 data={data}37 suffix="(Moving avg)"38 >39 {({ adjustedData }) => {40 return (41 <LineChart42 style={{ height: '20em' }}43 fullWidth44 fullHeight45 data={adjustedData}46 />47 );48 }}49 </MovingAverage>50 </>51 );52 }}53 </NrqlQuery>54 </GridItem>55 <GridItem columnSpan={4}>56 <h2>Imperative example</h2>57 <NrqlQuery58 pollInterval={pollInterval}59 accountId={accountId}60 query={`SELECT count(*) as 'Transactions' from Transaction timeseries max ${sinceClause}`}61 >62 {({ data }) => {63 const example2Data = MovingAverage.processData({64 data: data,65 window: 5,66 suffix: '(Moving avg)'67 });68 return (69 <LineChart70 style={{ height: '20em' }}71 fullWidth72 fullHeight73 data={example2Data}74 />75 );76 }}77 </NrqlQuery>78 </GridItem>79 <GridItem columnSpan={4}>80 <h2>Moving average only example</h2>81 <NrqlQuery82 pollInterval={pollInterval}83 accountId={accountId}84 query={`SELECT average(duration) as 'Duration' from Transaction timeseries max ${sinceClause}`}85 >86 {({ data }) => {87 return (88 <>89 <MovingAverage90 window={10}91 data={data}92 suffix="(Moving avg)"93 excludeOriginal94 >95 {({ adjustedData }) => {96 return (97 <LineChart98 style={{ height: '20em' }}99 fullWidth100 fullHeight101 data={adjustedData}102 />103 );104 }}105 </MovingAverage>106 </>107 );108 }}109 </NrqlQuery>110 </GridItem>111 <GridItem columnSpan={4}>112 <h2>Multiple data fields</h2>113 <NrqlQuery114 pollInterval={pollInterval}115 accountId={accountId}116 query={`SELECT average(duration) as 'Duration', count(*)/500 as 'Throughput' from Transaction timeseries max ${sinceClause}`}117 >118 {({ data }) => {119 return (120 <>121 <MovingAverage122 window={10}123 data={data}124 suffix="(Moving avg)"125 >126 {({ adjustedData }) => {127 return (128 <LineChart129 style={{ height: '20em' }}130 fullWidth131 fullHeight132 data={adjustedData}133 />134 );135 }}136 </MovingAverage>137 </>138 );139 }}140 </NrqlQuery>141 </GridItem>142 <GridItem columnSpan={4}>143 <h2>Specific window size</h2>144 <NrqlQuery145 pollInterval={pollInterval}146 accountId={accountId}147 query={`SELECT average(duration) as 'Duration' from Transaction timeseries max ${sinceClause}`}148 >149 {({ data }) => {150 return (151 <>152 <MovingAverage153 buckets={50}154 data={data}155 suffix="(Moving avg)"156 >157 {({ adjustedData }) => {158 return (159 <LineChart160 style={{ height: '20em' }}161 fullWidth162 fullHeight163 data={adjustedData}164 />165 );166 }}167 </MovingAverage>168 </>169 );170 }}171 </NrqlQuery>172 </GridItem>173 <GridItem columnSpan={4}>174 <h2>Percentiles</h2>175 <NrqlQuery176 pollInterval={pollInterval}177 accountId={accountId}178 query={`SELECT percentile(duration,50,75) as 'Duration' from Transaction timeseries max ${sinceClause}`}179 >180 {({ data }) => {181 return (182 <>183 <MovingAverage184 window={5}185 data={data}186 suffix="(Moving avg)"187 >188 {({ adjustedData }) => {189 return (190 <LineChart191 style={{ height: '20em' }}192 fullWidth193 fullHeight194 data={adjustedData}195 />196 );197 }}198 </MovingAverage>199 </>200 );201 }}202 </NrqlQuery>203 </GridItem>204 <GridItem columnSpan={4}>205 <h2>Faceted data</h2>206 <NrqlQuery207 pollInterval={pollInterval}208 accountId={accountId}209 query={`SELECT percentile(duration,90) as '90pc Duration' from Transaction facet appName limit 5 timeseries max ${sinceClause}`}210 >211 {({ data }) => {212 return (213 <>214 <MovingAverage215 window={5}216 data={data}217 suffix=""218 excludeOriginal219 >220 {({ adjustedData }) => {221 return (222 <LineChart223 style={{ height: '20em' }}224 fullWidth225 fullHeight226 data={adjustedData}227 />228 );229 }}230 </MovingAverage>231 </>232 );233 }}234 </NrqlQuery>235 </GridItem>236 <GridItem columnSpan={4}>237 <h2>Faceted data, multiple fields</h2>238 <NrqlQuery239 pollInterval={pollInterval}240 accountId={accountId}241 query={`SELECT count(*) as 'Throughput', average(duration) as duration from Transaction facet appName limit 5 timeseries max ${sinceClause}`}242 >243 {({ data }) => {244 return (245 <>246 <MovingAverage247 window={5}248 data={data}249 suffix=""250 excludeOriginal251 >252 {({ adjustedData }) => {253 return (254 <LineChart255 style={{ height: '20em' }}256 fullWidth257 fullHeight258 data={adjustedData}259 />260 );261 }}262 </MovingAverage>263 </>264 );265 }}266 </NrqlQuery>267 </GridItem>268 </Grid>269 </ChartGroup>270 );271 }}272 </PlatformStateContext.Consumer>273 </div>274 );275 }...

Full Screen

Full Screen

ucs-discovery-graph.js

Source:ucs-discovery-graph.js Github

copy

Full Screen

1// Copyright 2017, Dell EMC, Inc.2'use strict';3module.exports = {4 friendlyName: 'Ucs Discovery',5 injectableName: 'Graph.Ucs.Discovery',6 options: {7 defaults: {8 uri: null9 },10 'when-discover-physical-ucs' : {11 discoverPhysicalServers: 'true',12 updateExistingCatalog: true,13 when: '{{options.discoverPhysicalServers}}'14 },15 'when-discover-logical-ucs' : {16 discoverLogicalServer: 'true',17 updateExistingCatalog: true,18 when: '{{options.discoverLogicalServer}}'19 },20 'when-catalog-ucs' : {21 autoCatalogUcs: 'true',22 updateExistingCatalog: true,23 when: '{{options.autoCatalogUcs}}'24 },25 'skip-pollers': {26 skipPollersCreation: 'false',27 when: '{{options.skipPollersCreation}}'28 },29 'skip-ipmi-pollers': {30 skipIPMIPollersCreation: 'true',31 when: '{{options.skipIPMIPollersCreation}}'32 }33 },34 tasks: [35 {36 'x-description': 'Check to see if we need to discover physical UCS servers',37 label: 'when-discover-physical-ucs',38 taskName: 'Task.Evaluate.Condition',39 ignoreFailure: true40 },41 {42 'x-description': 'Check to see if we need to discover logical UCS servers',43 label: 'when-discover-logical-ucs',44 taskName: 'Task.Evaluate.Condition',45 ignoreFailure: true,46 },47 {48 'x-description': 'Discover physical UCS servers',49 label: 'ucs-physical-discovery',50 taskName: 'Task.Ucs.Discovery',51 waitOn: {52 'when-discover-physical-ucs': 'succeeded'53 }54 },55 {56 'x-description': 'Discover logical UCS servers',57 label: 'ucs-logical-discovery',58 taskName: 'Task.Ucs.Service.Profile.Discovery',59 waitOn: {60 'when-discover-logical-ucs': 'succeeded'61 }62 },63 {64 'x-description': 'UCS physical discovery finished',65 label: 'ucs-physical-discovery-done',66 taskName: 'Task.noop',67 waitOn: {68 anyOf: {69 'when-discover-physical-ucs': 'failed',70 'ucs-physical-discovery': 'succeeded'71 }72 }73 },74 {75 'x-description': 'UCS logical discovery finished',76 label: 'ucs-logical-discovery-done',77 taskName: 'Task.noop',78 waitOn: {79 anyOf: {80 'when-discover-logical-ucs': 'failed',81 'ucs-logical-discovery': 'succeeded'82 }83 }84 },85 {86 'x-description': 'Check to see if cataloging should be done',87 label: 'when-catalog-ucs',88 taskName: 'Task.Evaluate.Condition',89 waitOn: {90 'ucs-physical-discovery-done': 'succeeded',91 'ucs-logical-discovery-done': 'succeeded'92 },93 ignoreFailure: true94 },95 {96 label: 'ucs-catalog',97 taskName: 'Task.Ucs.Catalog',98 waitOn: {99 'when-catalog-ucs': 'succeeded'100 }101 },102 {103 label: 'skip-pollers',104 taskName: 'Task.Evaluate.Condition',105 waitOn: {106 'ucs-catalog': 'finished'107 },108 ignoreFailure: true109 },110 {111 label: 'create-ucs-pollers',112 taskDefinition: {113 friendlyName: 'Create Default Pollers',114 injectableName: 'Task.Inline.Pollers.CreateDefault',115 implementsTask: 'Task.Base.Pollers.CreateDefault',116 properties: {},117 options: {118 nodeId: null,119 pollers: [120 {121 "type": "ucs",122 "pollInterval": 60000,123 "config": {124 "command": "ucs.powerthermal"125 }126 },127 {128 "type": "ucs",129 "pollInterval": 60000,130 "config": {131 "command": "ucs.fan"132 }133 },134 {135 "type": "ucs",136 "pollInterval": 60000,137 "config": {138 "command": "ucs.psu"139 }140 },141 {142 "type": "ucs",143 "pollInterval": 60000,144 "config": {145 "command": "ucs.disk"146 }147 },148 {149 "type": "ucs",150 "pollInterval": 60000,151 "config": {152 "command": "ucs.led"153 }154 },155 {156 "type": "ucs",157 "pollInterval": 60000,158 "config": {159 "command": "ucs.sel"160 }161 }162 ]163 }164 },165 waitOn: {166 'ucs-catalog': 'succeeded',167 'skip-pollers': 'failed'168 }169 },170 {171 label: 'skip-ipmi-pollers',172 taskName: 'Task.Evaluate.Condition',173 waitOn: {174 'ucs-catalog': 'finished'175 },176 ignoreFailure: true177 },178 {179 label: 'create-ucs-ipmi-pollers',180 taskDefinition: {181 friendlyName: 'Create Default IPMI Pollers',182 injectableName: 'Task.Inline.Pollers.CreateDefault',183 implementsTask: 'Task.Base.Pollers.CreateDefault',184 properties: {},185 options: {186 nodeId: null,187 pollers: [188 {189 'type': 'ipmi',190 'pollInterval': 60000,191 'config': {192 'command': 'sdr'193 }194 },195 {196 'type': 'ipmi',197 'pollInterval': 60000,198 'config': {199 'command': 'selInformation'200 }201 },202 {203 'type': 'ipmi',204 'pollInterval': 60000,205 'config': {206 'command': 'sel'207 }208 },209 {210 'type': 'ipmi',211 'pollInterval': 60000,212 'config': {213 'command': 'selEntries'214 }215 },216 {217 'type': 'ipmi',218 'pollInterval': 60000,219 'config': {220 'command': 'chassis'221 }222 },223 {224 'type': 'ipmi',225 'pollInterval': 60000,226 'config': {227 'command': 'driveHealth'228 }229 }230 ]231 }232 },233 waitOn: {234 'ucs-catalog': 'succeeded',235 'skip-ipmi-pollers': 'failed'236 }237 },238 {239 'x-description': 'Set the final graph state to success when cataloging is skipped',240 label: 'noop',241 taskName: 'Task.noop',242 waitOn: {243 'when-catalog-ucs': 'failed'244 }245 }246 ]...

Full Screen

Full Screen

config-gscl.js

Source:config-gscl.js Github

copy

Full Screen

1var log4js = require('log4js');2/** SCL --------------------------------------------------------------------- */3var scl = {};4scl.host = '161.200.90.71';5//scl.host = '192.168.1.5';6scl.id = 'openmtc-gscl';7// mId config8scl.mid = {};9scl.mid.port = '4000';10scl.mid.ssl = {};11//scl.mid.ssl.key = './openmtc-GSCL/keys/mid-key.pem';12//scl.mid.ssl.cert = './openmtc-GSCL/keys/mid-cert.pem';13// dIa config14scl.dia = {};15scl.dia.port = '5000';16//scl.dia.network = '10.0.0.1/24';17// notification service18scl.notificationService = {};19scl.notificationService.contactResource = 'notificationService';20scl.notificationService.port = '5000';21scl.notificationService.secret = 'openmtc';22// websocket channels23scl.notificationService.ws = {};24scl.notificationService.ws.endpoint =25 'http://' + scl.host + ':' + scl.notificationService.port;26// misc27scl.sclBase = 'm2m';28//scl.secret = 'secret';29scl.contactResource = 'notify';30scl.registerInterval = '1000000';31scl.personality = 'GSCL';32// capabilities33scl.capabilities = [34 './lib/capabilities/grar',35 './lib/capabilities/ggc'36];37scl.gc = {};38scl.gc.communicationChannelManager = '';39//scl.gc.communicationChannelManager = './CommunicationChannelManager';40scl.gc.deferredRequestHandler = "DeferredRequestHandler";41/** HOST_SCL ---------------------------------------------------------------- */42var hostScl = {};43hostScl.host = '161.200.90.85';44//hostScl.host = '192.168.1.36';45hostScl.id = 'openmtc-nscl';46hostScl.port = '14000';47hostScl.sclBase = 'm2m';48//hostScl.secret = 'secret';49// DON'T CHANGE THIS50// TODO: uri should not include sclBase51hostScl.hostUri = 'http://' + hostScl.host + ':' + hostScl.port;52hostScl.uri = hostScl.hostUri + '/' + hostScl.sclBase;53/** DB ---------------------------------------------------------------------- */54var db = {};55db.driver = './db/mongodb';56// mongodb57db.host = 'localhost';58//db.host = '192.168.1.5';59db.port = 27017;60db.dropDB = 'true';61db.database = 'm2m_gscl';62// sqlite63db.storage = 'gscl.db';64db.prefix = 'gscl_';65/** LOGGING ----------------------------------------------------------------- */66var logging = {};67logging.logDir = '.';68logging.fileName = 'gscl.log';69logging.maxLogSize = 20480;70logging.backups = '0';71logging.pollInterval = 15;72logging.globalLogLevel = 'DEBUG';73//NapatK 2014102074// DON'T CHANGE THIS75// why not actually?76log4js.configure({77 'appenders': [78 {79 type: 'console',80 category: '[gscl]'81 },82 {83 type: 'console',84 category: '[nscl]'85 },86 {87 type: 'console',88 category: '[method]'89 },90 {91 type: 'console',92 category: '[transport]'93 },94 {95 type: 'console',96 category: '[database]'97 },98 {99 type: 'console',100 category: '[controller]'101 },102 {103 type: 'console',104 category: '[http]'105 },106 {107 type: 'console',108 category: '[https]'109 },110 {111 type: 'console',112 category: '[gip]'113 },114 { //rev.v1 for NIP created by napatk 01-07-2014115 type: 'console',116 category: '[nip]'117 },118 {119 type: 'console',120 category: '[app]'121 },122 {123 type: 'console',124 category: '[xIa]'125 },126 {127 type: 'file',128 filename: logging.fileName,129 maxLogSize: logging.maxLogSize,130 backups: logging.backups,131 pollInterval: logging.pollInterval,132 category: '[gscl]'133 },134 {135 type: 'file',136 filename: logging.fileName,137 maxLogSize: logging.maxLogSize,138 backups: logging.backups,139 pollInterval: 15,140 category: '[nscl]'141 },142 {143 type: 'file',144 filename: logging.fileName,145 maxLogSize: logging.maxLogSize,146 backups: logging.backups,147 pollInterval: logging.pollInterval,148 category: '[method]'149 },150 {151 type: 'file',152 filename: logging.fileName,153 maxLogSize: logging.maxLogSize,154 backups: logging.backups,155 pollInterval: logging.pollInterval,156 category: '[transport]'157 },158 {159 type: 'file',160 filename: logging.fileName,161 maxLogSize: logging.maxLogSize,162 backups: logging.backups,163 pollInterval: logging.pollInterval,164 category: '[database]'165 },166 {167 type: 'file',168 filename: logging.fileName,169 maxLogSize: logging.maxLogSize,170 backups: logging.backups,171 pollInterval: logging.pollInterval,172 category: '[controller]'173 },174 {175 type: 'file',176 filename: logging.fileName,177 maxLogSize: logging.maxLogSize,178 backups: logging.backups,179 pollInterval: logging.pollInterval,180 category: '[http]'181 },182 {183 type: 'file',184 filename: logging.fileName,185 maxLogSize: logging.maxLogSize,186 backups: logging.backups,187 pollInterval: logging.pollInterval,188 category: '[https]'189 },190 {191 type: 'file',192 filename: logging.fileName,193 maxLogSize: logging.maxLogSize,194 backups: logging.backups,195 pollInterval: logging.pollInterval,196 category: '[gip]'197 },198 { //rev.v1 for NIP created by napatk 01-07-2014199 type: 'file',200 filename: logging.fileName,201 maxLogSize: logging.maxLogSize,202 backups: logging.backups,203 pollInterval: logging.pollInterval,204 category: '[nip]'205 },206 {207 type: 'file',208 filename: logging.fileName,209 maxLogSize: logging.maxLogSize,210 backups: logging.backups,211 pollInterval: logging.pollInterval,212 category: '[app]'213 },214 {215 type: 'file',216 filename: logging.fileName,217 maxLogSize: logging.maxLogSize,218 backups: logging.backups,219 pollInterval: logging.pollInterval,220 category: '[xIa]'221 }222 ],223 replaceConsole: false224}, {cwd: logging.logDir});225log4js.setGlobalLogLevel(logging.globalLogLevel);226// DON'T CHANGE THIS227// TODO: pull this out of config228scl.uri = 'http://' + scl.host + ':' + scl.port + '/' + scl.sclBase;229scl.mid.uri = 'http://' + scl.host + ':' + scl.mid.port + '/' + scl.sclBase;230scl.dia.uri = 'http://' + scl.host + ':' + scl.dia.port + '/' + scl.sclBase;231scl.hostURI = 'http://' + scl.host + ':' + scl.port;232scl.mid.hostUri = 'http://' + scl.host + ':' + scl.mid.port;233scl.dia.hostUri = 'http://' + scl.host + ':' + scl.dia.port;234scl.contactURI = scl.mid.uri + '/' + scl.contactResource;235/** EXPORT ------------------------------------------------------------------ */236module.exports = {237 scl: scl,238 Hostscl: hostScl,239 db: db,240 logging: logging,241 log4js: log4js...

Full Screen

Full Screen

config-nscl.js

Source:config-nscl.js Github

copy

Full Screen

1ipserv = require('./ipserv.js');2var log4js = require('log4js');3/** SCL --------------------------------------------------------------------- */4var scl = {};5scl.host = ipserv.ipnscl;6//scl.host = 'localhost';7scl.id = 'openmtc-nscl';8// mId config9scl.mid = {};10scl.mid.port = '14000';11scl.mid.ssl = {};12// scl.mid.ssl.key = './openmtc-NSCL/keys/mid-key.pem';13// scl.mid.ssl.cert = './openmtc-NSCL/keys/mid-cert.pem';14// dIa config15scl.dia = {};16scl.dia.port = '15000';17//scl.dia.network = '10.0.0.1/24';18// notification service19scl.notificationService = {};20scl.notificationService.port = '8081';21scl.notificationService.secret = 'openmtc';22scl.notificationService.contactResource = 'notificationService';23// misc24scl.sclBase = 'm2m';25//scl.secret = 'secret';26scl.contactResource = 'notify';27scl.personality = 'NSCL';28// capabilities29scl.capabilities = [30 './lib/capabilities/nrar'31];32/** DB ---------------------------------------------------------------------- */33var db = {};34db.driver = './db/mongodb';35// mongodb36db.host = ipserv.ipnscl;37db.port = 27017;38db.dropDB = 'true';39db.database = 'm2m_nscl';40//sqlite41db.storage = 'nscl.db';42db.prefix = 'nscl_';43// Redis44db.redis = {};45db.redis.host = 'localhost';46db.redis.port = 6379;47/** LOGGING ----------------------------------------------------------------- */48var logging = {};49logging.logDir = '.';50logging.fileName = 'nscl.log';51logging.maxLogSize = 20480;52logging.backups = '0';53logging.pollInterval = 15;54logging.globalLogLevel = 'DEBUG';55//NapatK 2014102056// DON'T CHANGE THIS57// why not actually?58log4js.configure({59 'appenders': [60 {61 type: 'console',62 category: '[gscl]'63 },64 {65 type: 'console',66 category: '[nscl]'67 },68 {69 type: 'console',70 category: '[method]'71 },72 {73 type: 'console',74 category: '[transport]'75 },76 {77 type: 'console',78 category: '[database]'79 },80 {81 type: 'console',82 category: '[controller]'83 },84 {85 type: 'console',86 category: '[http]'87 },88 {89 type: 'console',90 category: '[https]'91 },92 {93 type: 'console',94 category: '[gip]'95 },96 { //rev.v1 for NIP created by napatk 01-07-201497 type: 'console',98 category: '[nip]'99 },100 {101 type: 'console',102 category: '[app]'103 },104 {105 type: 'console',106 category: '[xIa]'107 },108 {109 type: 'file',110 filename: logging.fileName,111 maxLogSize: logging.maxLogSize,112 backups: logging.backups,113 pollInterval: logging.pollInterval,114 category: '[gscl]'115 },116 {117 type: 'file',118 filename: logging.fileName,119 maxLogSize: logging.maxLogSize,120 backups: logging.backups,121 pollInterval: 15,122 category: '[nscl]'123 },124 {125 type: 'file',126 filename: logging.fileName,127 maxLogSize: logging.maxLogSize,128 backups: logging.backups,129 pollInterval: logging.pollInterval,130 category: '[method]'131 },132 {133 type: 'file',134 filename: logging.fileName,135 maxLogSize: logging.maxLogSize,136 backups: logging.backups,137 pollInterval: logging.pollInterval,138 category: '[transport]'139 },140 {141 type: 'file',142 filename: logging.fileName,143 maxLogSize: logging.maxLogSize,144 backups: logging.backups,145 pollInterval: logging.pollInterval,146 category: '[database]'147 },148 {149 type: 'file',150 filename: logging.fileName,151 maxLogSize: logging.maxLogSize,152 backups: logging.backups,153 pollInterval: logging.pollInterval,154 category: '[controller]'155 },156 {157 type: 'file',158 filename: logging.fileName,159 maxLogSize: logging.maxLogSize,160 backups: logging.backups,161 pollInterval: logging.pollInterval,162 category: '[http]'163 },164 {165 type: 'file',166 filename: logging.fileName,167 maxLogSize: logging.maxLogSize,168 backups: logging.backups,169 pollInterval: logging.pollInterval,170 category: '[https]'171 },172 {173 type: 'file',174 filename: logging.fileName,175 maxLogSize: logging.maxLogSize,176 backups: logging.backups,177 pollInterval: logging.pollInterval,178 category: '[gip]'179 },180 { //rev.v1 for NIP created by napatk 01-07-2014181 type: 'file',182 filename: logging.fileName,183 maxLogSize: logging.maxLogSize,184 backups: logging.backups,185 pollInterval: logging.pollInterval,186 category: '[nip]'187 },188 {189 type: 'file',190 filename: logging.fileName,191 maxLogSize: logging.maxLogSize,192 backups: logging.backups,193 pollInterval: logging.pollInterval,194 category: '[app]'195 },196 {197 type: 'file',198 filename: logging.fileName,199 maxLogSize: logging.maxLogSize,200 backups: logging.backups,201 pollInterval: logging.pollInterval,202 category: '[xIa]'203 }204 ],205 replaceConsole: false206}, {cwd: logging.logDir});207log4js.setGlobalLogLevel(logging.globalLogLevel);208// DON'T CHANGE THIS209// TODO: pull this out of config210scl.uri = 'http://' + scl.host + ':' + scl.port + '/' + scl.sclBase;211scl.mid.uri = 'http://' + scl.host + ':' + scl.mid.port + '/' + scl.sclBase;212scl.dia.uri = 'http://' + scl.host + ':' + scl.dia.port + '/' + scl.sclBase;213scl.hostURI = 'http://' + scl.host + ':' + scl.port;214scl.mid.hostUri = 'http://' + scl.host + ':' + scl.mid.port;215scl.dia.hostUri = 'http://' + scl.host + ':' + scl.dia.port;216scl.contactURI = scl.mid.uri + '/' + scl.contactResource;217/** EXPORT ------------------------------------------------------------------ */218module.exports = {219 scl: scl,220 db: db,221 logging: logging,222 log4js: log4js...

Full Screen

Full Screen

YSymbolsDialog.js

Source:YSymbolsDialog.js Github

copy

Full Screen

1/*2 * ***** BEGIN LICENSE BLOCK *****3 * Zimbra Collaboration Suite Zimlets4 * Copyright (C) 2007, 2008, 2009, 2010 Zimbra, Inc.5 * 6 * The contents of this file are subject to the Zimbra Public License7 * Version 1.3 ("License"); you may not use this file except in8 * compliance with the License. You may obtain a copy of the License at9 * http://www.zimbra.com/license.10 * 11 * Software distributed under the License is distributed on an "AS IS"12 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.13 * ***** END LICENSE BLOCK *****14 */15YSymbolsDialog = function(shell, className, parent) {16 className = className || "YSymbolsDialog";17 this._zimlet = parent;18 var title = "Stock polling options";19 DwtDialog.call(this, {parent:shell, className:className, title:title});20 this.setButtonListener(DwtDialog.OK_BUTTON, new AjxListener(this, this._symbolSelected));21 this._createSearchHtml();22 DBG.println("user prop:"+this._zimlet.getUserProperty("stockSymbols"));23};24YSymbolsDialog.prototype = new DwtDialog;25YSymbolsDialog.prototype.constructor = YSymbolsDialog;26YSymbolsDialog.prototype._lookupCallback;27YSymbolsDialog.prototype._createSearchHtml = function() {28 this._textObj = new DwtInputField(this);29 this._searchBtn = new DwtButton({parent:this});30 this._searchBtn.setText("Add Symbol"); 31 this._searchBtn.addSelectionListener(new AjxListener(this, this._searchButtonListener)); 32 var symbols = this._zimlet.getUserProperty("stockSymbols");33 if(symbols){34 this._textObj.setValue(symbols);35 }36 var pollInterval = this._zimlet.getUserProperty("pollInterval");37 this._pollInterval = new DwtSelect({parent:this, options:[ 38 new DwtSelectOption("", (pollInterval==""), "None"),39 new DwtSelectOption("1", (pollInterval=="1"), "1 minute"),40 new DwtSelectOption("2", (pollInterval=="2"), "2 minutes"),41 new DwtSelectOption("3", (pollInterval=="3"), "3 minutes"),42 new DwtSelectOption("4", (pollInterval=="4"), "4 minutes"),43 new DwtSelectOption("5", (pollInterval=="5"), "5 minutes"),44 new DwtSelectOption("10",(pollInterval=="10"), "10 minutes"),45 new DwtSelectOption("20",(pollInterval=="20"), "20 minutes"),46 new DwtSelectOption("30",(pollInterval=="30"), "30 minutes")47 ]});48 var table = document.createElement("TABLE");49 table.border = 0;50 table.cellPadding = 0;51 table.cellSpacing = 4;52 var row = table.insertRow(-1);53 var cell = row.insertCell(-1);54 cell.colSpan = 2;55 cell.innerHTML = "Enter stock symbol to be checked periodically";56 row = table.insertRow(-1);57 cell = row.insertCell(-1);58 cell.appendChild(this._textObj.getHtmlElement());59 cell = row.insertCell(-1);60 cell.appendChild(this._searchBtn.getHtmlElement());61 row = table.insertRow(-1);62 cell = row.insertCell(-1);63 cell.colSpan = 2; 64 cell.innerHTML = "Poll Interval :";65 cell.appendChild(this._pollInterval.getHtmlElement());66 var element = this._getContentDiv();67 element.appendChild(table);68// element.appendChild(this._textObj.getHtmlElement());69// element.appendChild(this._searchBtn.getHtmlElement());70};71YSymbolsDialog.prototype._searchButtonListener =72function(){73 this._symbolDialog = new YSymbolLookupDialog(appCtxt._shell, null, this._zimlet); 74 this._symbolDialog.popup(null,new AjxCallback(this, this._symbolSelectionHandler));75};76YSymbolsDialog.prototype._symbolSelectionHandler =77function(symbol){78 if(!symbol){ 79 return; 80 }81 var z = this._textObj.getValue();82 z += ",";83 if(z.indexOf(symbol)<0){84 this._textObj.setValue( ((z==",")?"":z) + symbol);85 } 86};87YSymbolsDialog.prototype.popup = function(name, callback) {88 89 this._lookupCallback = callback;90 this.setTitle("Yahoo! Finance - Stock Polling Preferences");91 92 // enable buttons93 this.setButtonEnabled(DwtDialog.OK_BUTTON, true);94 this.setButtonEnabled(DwtDialog.CANCEL_BUTTON, true);95 96 // show97 DwtDialog.prototype.popup.call(this);98};99YSymbolsDialog.prototype.popdown = 100function() {101 ZmDialog.prototype.popdown.call(this);102};103YSymbolsDialog.prototype._symbolSelected =104function(){105 this._zimlet.setUserProperty("stockSymbols", this._textObj.getValue());106 this._zimlet.setUserProperty("pollInterval", this._pollInterval.getValue(), true);107 this.popdown();108 if(this._pollInterval.getValue()!=""){109 this._zimlet._displayStockStatus();110 }...

Full Screen

Full Screen

server.js

Source:server.js Github

copy

Full Screen

1const express = require('express');2const cors = require('cors');3const routes = require('./routes');4const middlewares = require('./middlewares');5const config = require('./config').express;6const db = require('./database/knex');7const {8 pollPurchaseOrders, pollInvoice, pollDelivery, pollPayment, pollCreditNote,9} = require('./processes/poll');10const app = express();11// middleware12app.use(cors({ maxAge: config.maxAge }));13app.use(express.json());14app.use(express.urlencoded({ extended: true }));15app.use(middlewares.timeout(config.timeout));16app.db = db;17app.use('/', routes);18app.use(middlewares.notFound);19app.use(middlewares.error);20pollPurchaseOrders();21setInterval(pollPurchaseOrders, config.pollInterval);22setTimeout(() => {23 pollInvoice();24 setInterval(pollInvoice, config.pollInterval);25}, config.pollInterval / 3);26setTimeout(() => {27 pollCreditNote();28 setInterval(pollCreditNote, config.pollInterval);29}, config.pollInterval / 4);30setTimeout(() => {31 pollDelivery();32 setInterval(pollDelivery, config.pollInterval);33}, (config.pollInterval * 2) / 3);34setTimeout(() => {35 pollPayment();36 setInterval(pollPayment, config.pollInterval);37}, config.pollInterval / 4);38app.listen(config.port, () => {39 console.log(`Listening on port ${config.port}.`);...

Full Screen

Full Screen

wait-for.js

Source:wait-for.js Github

copy

Full Screen

1/* eslint-disable2 max-len,3*/4// TODO: This file was created by bulk-decaffeinate.5// Fix any style issues and re-enable lint.6/*7 * decaffeinate suggestions:8 * DS102: Remove unnecessary code created because of implicit returns9 * DS207: Consider shorter variations of null checks10 * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md11 */12import App from '../base'13export default App.factory('waitFor', function($q) {14 const waitFor = function(testFunction, timeout, pollInterval) {15 if (pollInterval == null) {16 pollInterval = 50017 }18 const iterationLimit = Math.floor(timeout / pollInterval)19 let iterations = 020 return $q(function(resolve, reject) {21 let tryIteration22 return (tryIteration = function() {23 if (iterations > iterationLimit) {24 return reject(25 new Error(26 `waiting too long, ${JSON.stringify({ timeout, pollInterval })}`27 )28 )29 }30 iterations += 131 const result = testFunction()32 if (result != null) {33 return resolve(result)34 } else {35 return setTimeout(tryIteration, pollInterval)36 }37 })()38 })39 }40 return waitFor...

Full Screen

Full Screen

HomePage.js

Source:HomePage.js Github

copy

Full Screen

1import React, { Component } from 'react';2//import axios from 'axios';3import RoutinePage from './RoutinePage';4class HomePage extends Component {5 constructor(props) {6 super(props);7 //this.state = { data: [] };8 //this.loadDataFromServer = this.loadDataFromServer.bind(this);9 this.pollInterval = null;10 }11 /* For future features that will load more user preferences into app12 loadDataFromServer() {13 axios.get()14 .then(res => {15 this.setState({ data: res.data });16 }) 17 }*/18 componentDidMount() {19 //this.loadDataFromServer();20 if (!this.pollInterval) {21 this.pollInterval = setInterval(this.props.pollInterval);22 //this.pollInterval = setInterval(this.loadDataFromServer, this.props.pollInterval);23 } 24 }25 26 //this will prevent error messages every 2 seconds27 //after HomePage is unmounted28 componentWillUnmount() {29 //this.pollInterval && clearInterval(this.pollInterval);30 clearInterval(this.pollInterval);31 this.pollInterval = null;32 }33 render() {34 return (35 <div>36 <h2>Randomize Your Workout</h2>37 < RoutinePage />38 </div>39 )40 }41}...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch({headless: false});4 const page = await browser.newPage();5 await page.waitForSelector('input[name="q"]');6 await page.type('input[name="q"]', 'Puppeteer');7 await page.keyboard.press('Enter');8 await page.waitForNavigation();9 await page.waitFor(1000);10 await page.screenshot({path: 'google.png'});11 await browser.close();12})();13const puppeteer = require('puppeteer');14(async () => {15 const browser = await puppeteer.launch({headless: false});16 const page = await browser.newPage();17 await page.waitForSelector('input[name="q"]');18 await page.type('input[name="q"]', 'Puppeteer');19 await page.keyboard.press('Enter');20 await page.waitForNavigation();21 await page.waitFor(1000);22 await page.screenshot({path: 'google.png'});23 await browser.close();24})();25const puppeteer = require('puppeteer');26(async () => {27 const browser = await puppeteer.launch({headless: false});28 const page = await browser.newPage();29 await page.waitForSelector('input[name="q"]');30 await page.type('input[name="q"]', 'Puppeteer');31 await page.keyboard.press('Enter');32 await page.waitForNavigation();33 await page.waitFor(1000);34 await page.screenshot({path: 'google.png'});35 await browser.close();36})();37const puppeteer = require('puppeteer');38(async () => {39 const browser = await puppeteer.launch({headless: false});40 const page = await browser.newPage();41 await page.waitForSelector('input[name="q"]');42 await page.type('input[name="q"]', 'Puppeteer');43 await page.keyboard.press('Enter');44 await page.waitForNavigation();45 await page.waitFor(1000);46 await page.screenshot({path

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch({4 });5 const page = await browser.newPage();6 await page.waitFor(1000);7 await page.type('input[name="q"]', 'Puppeteer');8 await page.waitFor(1000);9 await page.keyboard.press('Enter');10 await page.waitFor(1000);11 await page.waitForSelector('h3.LC20lb');12 await page.waitFor(1000);13 await page.screenshot({14 });15 await browser.close();16})();17![Output](

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2const fs = require('fs');3(async () => {4 const browser = await puppeteer.launch();5 const page = await browser.newPage();6 await page.waitForSelector('input[name="q"]');7 await page.type('input[name="q"]', 'Puppeteer');8 await page.waitFor(1000);9 await page.click('input[name="btnK"]');10 await page.waitForSelector('#resultStats');11 await page.waitFor(2000);12 await page.screenshot({path: 'example.png'});13 await browser.close();14})();15const puppeteer = require('puppeteer');16const fs = require('fs');17(async () => {18 const browser = await puppeteer.launch();19 const page = await browser.newPage();20 await page.waitForSelector('input[name="q"]');21 await page.type('input[name="q"]', 'Puppeteer');22 await page.waitFor(1000);23 await page.click('input[name="btnK"]');24 await page.waitForSelector('#resultStats');25 await page.waitFor(2000);26 await page.screenshot({path: 'example.png'});27 await browser.close();28})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch();4 const page = await browser.newPage();5 await page.waitForSelector('input[name="q"]');6 await page.type('input[name="q"]', 'Puppeteer');7 await page.keyboard.press('Enter');8 await page.waitForNavigation();9 await page.waitForSelector('h3');10 await page.screenshot({path: 'google.png'});11 await browser.close();12})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch();4 const page = await browser.newPage();5 await page.waitForNavigation({ waitUntil: 'networkidle0' });6 console.log('Example.com loaded!');7 await browser.close();8})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch({headless: false});4 const page = await browser.newPage();5 await page.waitFor(2000);6 await page.screenshot({path: 'google.png'});7 await browser.close();8})();9const puppeteer = require('puppeteer');10(async () => {11 const browser = await puppeteer.launch({headless: false});12 const page = await browser.newPage();13 await page.waitForNavigation();14 await page.screenshot({path: 'google.png'});15 await browser.close();16})();17const puppeteer = require('puppeteer');18(async () => {19 const browser = await puppeteer.launch({headless: false});20 const page = await browser.newPage();21 await page.waitForSelector('input');22 await page.screenshot({path: 'google.png'});23 await browser.close();24})();25const puppeteer = require('puppeteer');26(async () => {27 const browser = await puppeteer.launch({headless: false});28 const page = await browser.newPage();29 await page.screenshot({path: 'google.png'});30 await browser.close();31})();32const puppeteer = require('puppeteer');33(async () => {34 const browser = await puppeteer.launch({headless: false});35 const page = await browser.newPage();36 await page.screenshot({path: 'google.png'});37 await browser.close();38})();39const puppeteer = require('puppeteer');40(async () => {41 const browser = await puppeteer.launch({headless: false});42 const page = await browser.newPage();43 await page.goto('http

Full Screen

Using AI Code Generation

copy

Full Screen

1(async () => {2 const browser = await puppeteer.launch();3 const page = await browser.newPage();4 await page.waitForFunction('document.querySelector("h1").innerText === "Example Domain"', {5 });6 await browser.close();7})();8(async () => {9 const browser = await puppeteer.launch();10 const page = await browser.newPage();11 await page.waitForSelector('h1');12 await browser.close();13})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2const assert = require('assert');3(async () => {4 const browser = await puppeteer.launch();5 const page = await browser.newPage();6 const element = await page.waitForSelector('input[name="q"]', {7 });8 assert(element);9 await browser.close();10})();11const puppeteer = require('puppeteer');12const assert = require('assert');13(async () => {14 const browser = await puppeteer.launch();15 const page = await browser.newPage();16 const element = await page.waitForFunction(17 'document.querySelector("input[name=\'q\']").value === "Puppeteer"',18 {19 }20 );21 assert(element);22 await browser.close();23})();24const puppeteer = require('puppeteer');25const assert = require('assert');26(async () => {27 const browser = await puppeteer.launch();28 const page = await browser.newPage();29 assert(request);30 await browser.close();31})();32const puppeteer = require('puppeteer');33const assert = require('assert');34(async () => {35 const browser = await puppeteer.launch();36 const page = await browser.newPage();37 assert(response);38 await browser.close();39})();40const puppeteer = require('puppeteer');41const assert = require('assert');42(async () => {

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Puppeteer automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful