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
//============================ | |
// mixi setup | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
_mixi = [[Mixi sharedMixi] setupWithType:kMixiApiTypeSelectorGraphApi | |
clientId:@"87b9651a2291e4853ac0" | |
secret:@"98866989c89c42e47d7d38394637faa84341ebb4" | |
appId:@"piccollage"]; | |
[_mixi restore]; | |
[_mixi reportOncePerDay]; |
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
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url | |
sourceApplication:(NSString *)sourceApplication | |
annotation:(id)annotation | |
{ | |
NSLog(@"handleOpenURL %@", [[url absoluteString] stringByReplacingPercentEscapesUsingEncoding:NSASCIIStringEncoding]); | |
NSError *error = nil; | |
if ([[url scheme] isEqualToString:@"mixiapp-piccollage"]) { | |
NSString *apiType = [[Mixi sharedMixi] application:application openURL:url sourceApplication:sourceApplication annotation:annotation error:&error]; | |
if (error) { | |
} |
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 | |
/** | |
* Envolve API Client Library | |
* | |
* @version 0.1 | |
*/ | |
/** | |
* This method creates the full HTML that should be included in a page for an anonymous user. |
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
class GeckoboardController < ActionController::Base | |
def newrelic | |
@newrelic_data = newrelic_data | |
render_board | |
end | |
private | |
def render_board | |
render :layout => false, :content_type => 'application/xml' |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<% epm = @newrelic_data["Errors"][0..-5].to_i %> | |
<% rpm = @newrelic_data["Throughput"][0..-5].to_i %> | |
<% response_time = @newrelic_data["Response Time"][0..-4].to_i %> | |
<% db = @newrelic_data["DB"][0..-2].to_f %> | |
<% cpu = @newrelic_data["CPU"][0..-2].to_f %> | |
<% db_time = db.to_f/100*response_time.to_f %> | |
<% cpu_time = cpu.to_f/100*response_time.to_f %> | |
<% other_time = response_time.to_f - db_time - cpu_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
# returns like this: | |
# {"Apdex"=>"0.85 [0.5]", "Error Rate"=>"0.33%", | |
# "Throughput"=>"202 rpm", "CPU"=>"11%", "Response Time"=>"330 ms", | |
# "Errors"=>"0.67 epm", "Memory"=>"135 MB", "DB"=>"4.3%"} | |
def newrelic_data | |
key = Variant.current.newrelic_api_key | |
url = Variant.current.newrelic_data_url | |
return {} unless url # not using newrelic |