Skip to content

Instantly share code, notes, and snippets.

@JamesPaden
Last active September 28, 2016 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamesPaden/c64d82d78e79a8bed102747f5322a335 to your computer and use it in GitHub Desktop.
Save JamesPaden/c64d82d78e79a8bed102747f5322a335 to your computer and use it in GitHub Desktop.
Example usages of Instrumental Notices in various languages
var I = require('instrumental-node');
I.configure({ apiKey: 'YOUR_PROJECT_TOKEN' });
// WITHOUT DURATION
I.notice('Deployed database query rewrites')
// WITH DURATION
start_time = Date.now()
// Maybe put your deploy code here?
I.notice('Deployed more database query rewrites', start_time, Date.now() - start_time)
<?php
# autoload composer packages
require __DIR__ . '/vendor/autoload.php';
$I = new \Instrumental\Agent();
$I->setApiKey("YOUR_PROJECT_TOKEN");
# WITHOUT DURATION
$I->notice('Deployed database query rewrites');
# WITH DURATION
$start_time = time();
sleep(10); # deploy code goes here?
$I->notice('Deployed more database query rewrites', $start_time, time() - $start_time);
import time
from instrumental_agent import Agent
i = Agent("YOUR_PROJECT_TOKEN", enabled=True)
# WITHOUT DURATION
i.notice('Deployed database query rewrites')
# WITH DURATION
start_time = time.time()
time.sleep(10) # deploy code goes here?
i.notice('Deployed more database query rewrites', start_time, time.time() - start_time)
require 'instrumental_agent'
require 'benchmark'
I = Instrumental::Agent.new('YOUR_PROJECT_TOKEN')
# WITHOUT DURATION
I.notice('Deployed database query rewrites')
# WITH DURATION
start_time = Time.now
sleep 10 # deploy code goes here?
I.notice('Deployed more database query rewrites', start_time, Time.now - start_time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment