Пример #1
0
func fetch(t time.Time, inbox chan<- *store.Bucket) {
	fmt.Printf("at=start_fetch minute=%d\n", t.Minute())
	mailbox := fmt.Sprintf("librato_outlet.%d", partitionId)
	for bucket := range store.ScanBuckets(mailbox) {
		inbox <- bucket
	}
}
Пример #2
0
func fetch(t time.Time, outbox chan<- *store.Bucket) {
	fmt.Printf("at=start_fetch minute=%d\n", t.Minute())
	defer utils.MeasureT("postgres_outlet.fetch", time.Now())

	mailbox := fmt.Sprintf("postgres_outlet.%d", partitionId)
	for bucket := range store.ScanBuckets(mailbox) {
		outbox <- bucket
	}
}
Пример #3
0
func fetch(t time.Time, inbox chan<- *store.Bucket) {
	pid, err := utils.LockPartition("librato_outlet", numPartitions, lockTTL)
	if err != nil {
		log.Fatal("Unable to lock partition.")
	}
	fmt.Printf("at=start_fetch minute=%d\n", t.Minute())
	mailbox := fmt.Sprintf("librato_outlet.%d", pid)
	for bucket := range store.ScanBuckets(mailbox) {
		inbox <- bucket
	}
}
Пример #4
0
func fetch(t time.Time, outbox chan<- *store.Bucket) {
	fmt.Printf("at=start_fetch minute=%d\n", t.Minute())
	defer utils.MeasureT("postgres_outlet.fetch", time.Now())

	pid, err := utils.LockPartition("postgres_outlet", numPartitions, lockTTL)
	if err != nil {
		log.Fatal("Unable to lock partition.")
	}

	mailbox := fmt.Sprintf("postgres_outlet.%d", pid)
	for bucket := range store.ScanBuckets(mailbox) {
		outbox <- bucket
	}
}