Running 30s test @ http://kuiperbelt:8080/broadcast
8 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 10.72ms 3.60ms 41.18ms 73.30%
Req/Sec 4.85k 734.00 6.69k 73.54%
1143522 requests in 30.00s, 146.13MB read
Requests/sec: 38120.60
Transfer/sec: 4.87MB
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
package main | |
import ( | |
"bytes" | |
"io" | |
"log" | |
"net/http" | |
) | |
var broadcastMessages = make(chan []byte) |
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
package main | |
import ( | |
"encoding/json" | |
"encoding/xml" | |
"io" | |
"log" | |
"os" | |
"strings" | |
) |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"github.com/ziutek/mymysql/mysql" | |
_ "github.com/ziutek/mymysql/native" | |
"io" | |
"log" | |
"os" |
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
void setup() { | |
pinMode(13, OUTPUT); | |
Serial.begin(9600); | |
} | |
char data; | |
int f = 0; | |
void loop() { | |
if (Serial.available() > 0) { | |
data = Serial.read(); |
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
package kuiperbelt | |
import ( | |
"log" | |
"sync" | |
) | |
type BroadcastNotifier struct { | |
notifyChan chan bool | |
notifyingChan chan bool |
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
my @input_numbers = (1, 2, 4, 8, 16, 32, 64); | |
my @result = map { | |
my @digits = split //,$_; # $_を文字列として1文字ずつに分解する => 桁ごとに分解 | |
if ($digits[-1] == 4) { # 一番最期の桁(=1の位)の桁がもし4であれば | |
@digits; #すべての桁をリストとして返す | |
} else { #そうでなければ | |
(); # なにも返さない | |
} | |
} @input_numbers; |
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
use strict; | |
use warnings; | |
use utf8; | |
use File::Spec; | |
use File::Basename; | |
use lib File::Spec->catdir(dirname(__FILE__), 'extlib', 'lib', 'perl5'); | |
use lib File::Spec->catdir(dirname(__FILE__), 'lib'); | |
use Amon2::Lite; | |
our $VERSION = '0.12'; |
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
package main | |
import ( | |
"fmt" | |
"github.com/codegangsta/cli" | |
"log" | |
"net/http" | |
"os" | |
"time" | |
) |
OlderNewer