This file contains hidden or 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
$ ./prometheus | |
prometheus, version 9dde930 (feature/build-info-and-startup-friendliness) | |
build user: [email protected] | |
build date: 20130425-15:07:14 | |
go version: 1.0.3 | |
leveldb version: 1.9.0 | |
protobuf version: 2.5.0 | |
snappy version: 1.1.0 | |
2013/04/25 15:21:51 Pool for job prometheus does not exist; creating and starting... | |
2013/04/25 15:21:51 All EndPoints for service [ MetricsService ] , registered under root path: /api/ |
This file contains hidden or 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
// This callback accumulates the microsecond duration of the reporting | |
// framework's overhead such that it can be reported. | |
var requestLatencyAccumulator = func(began time.Time) { | |
microseconds := float64(time.Since(began) / time.Microsecond) | |
requestLatency.Add(nil, microseconds) | |
} | |
func (registry registry) Handler() http.HandlerFunc { | |
return func(w http.ResponseWriter, r *http.Request) { |
This file contains hidden or 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
// This callback accumulates the microsecond duration of the reporting | |
// framework's overhead such that it can be reported. | |
var requestLatencyAccumulator CompletionCallback = func(duration time.Duration) { | |
microseconds := float64(duration / time.Microsecond) | |
requestLatency.Add(nil, microseconds) | |
} | |
func (registry registry) Handler() http.HandlerFunc { | |
return func(w http.ResponseWriter, r *http.Request) { |
This file contains hidden or 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 ( | |
scrapeInterval = flag.Duration("interval", 60 * time.Second, "Scrape interval") | |
) | |
// ... | |
tick := time.Tick(*scrapeInterval) | |
for { | |
select { | |
case conf = <-configChan: |
This file contains hidden or 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
build/ | |
!Makefile | |
!.gitkeep |
This file contains hidden or 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
~/.../storage/metric > go test -v | |
warning: building out-of-date packages: | |
github.com/prometheus/prometheus/model/generated | |
github.com/prometheus/prometheus/model | |
github.com/prometheus/prometheus/storage/raw/index/leveldb | |
installing these packages with 'go test -i' will speed future tests. | |
=== RUN TestCurator | |
--- PASS: TestCurator (0.01 seconds) | |
=== RUN TestLevelDBGetFingerprintsForLabelSet |
This file contains hidden or 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 'queue' | |
# Simplified version of the pooling from datamapper's data_objects. | |
# https://github.com/datamapper/do/blob/master/data_objects/lib/data_objects/pooling.rb | |
class Moped::Session | |
class << self | |
alias new __new | |
end | |
@__pool_lock = Mutex.new |
This file contains hidden or 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 'queue' | |
module Rack | |
module Mongoid | |
module Middleware | |
class Sessions | |
def initialize(app) | |
@app = app | |
@sessions = Queue.new |
This file contains hidden or 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
{BinaryHeap} = require "binary-heap" | |
# A non-blocking priority queue, backed by a binary heap. Supports optional | |
# timeouts for pop() calls. | |
# | |
# An example: | |
# queue = new Queue (x, y) -> x.priority < y.priority | |
# | |
# queue.pop 0, (item) -> console.log('worker 1:', item.body) | |
# queue.pop 0, (item) -> console.log('worker 2:', item.body) |
This file contains hidden or 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
set nocompatible | |
syntax on | |
filetype on | |
filetype indent on | |
set directory=/tmp | |
set expandtab | |
set hidden | |
set history=1000 |