Last active
September 28, 2016 18:07
-
-
Save JamesPaden/c64d82d78e79a8bed102747f5322a335 to your computer and use it in GitHub Desktop.
Example usages of Instrumental Notices in various languages
This file contains 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
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) | |
This file contains 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
<?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); |
This file contains 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
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) |
This file contains 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
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