Skip to content

Instantly share code, notes, and snippets.

View kolobaev's full-sized avatar

Vladimir Kolobaev kolobaev

View GitHub Profile
SELECT *
FROM system.mutations
WHERE is_done = 0
Row 1:
──────
database: graphite
table: series
mutation_id: 0000000067
command: DELETE WHERE Path LIKE 'complex.delete_me._avi-http01.%'
package seriesList
import (
"fmt"
"math"
"strconv"
"github.com/go-graphite/carbonapi/expr/helper"
"github.com/go-graphite/carbonapi/expr/interfaces"
"github.com/go-graphite/carbonapi/expr/types"
@kolobaev
kolobaev / escalation.go
Created August 14, 2019 11:41
database/redis/escalation.go
package redis
import (
"encoding/json"
"fmt"
"github.com/garyburd/redigo/redis"
"github.com/moira-alert/moira"
"github.com/moira-alert/moira/database/redis/reply"
@kolobaev
kolobaev / escalation.go
Last active August 14, 2019 11:39
moira/notifier/escalations/escalation.go
package escalations
import (
"fmt"
"sync"
"time"
"gopkg.in/tomb.v2"
"github.com/moira-alert/moira"
@transaction.atomic()
def save(self, device, full=True):
manufacturer_id = self._get_manufacturer_id(device.manufacturer)
device_type_id = self._get_device_type_id(device.model, manufacturer_id)
key = dict(
site_id=AVITO_SITE_ID,
device_type_id=device_type_id,
device_role_id=self._get_device_role_id('server'),
)
/* global _ */
/*
* Complex scripted dashboard
* This script generates a dashboard object that Grafana can load. It also takes a number of user
* supplied URL parameters (in the ARGS variable)
*
* Return a dashboard object, or a function
*
* For async scripts, return a function, this function must take a single callback function as argument,