Skip to content

Instantly share code, notes, and snippets.

@cosh
cosh / gist:5e7446398579da80bbde
Last active August 29, 2015 14:05
cassandra benchmark on google compute engine
{\"totalCassandraClientCalls\":100000,\"totalStatements\":10000000,\"clientCallsPerSecond\":151.76885641078067,\"statementsPerSecond\":15176.885641078068,\"meanlatency_clientCall\":38.13840072274,\"medianlatency_clientCall\":263.21751,\"ninetyFiveTh_clientCall\":12.440169,\"ninetyNineTh_clientCall\":130.07639799999998,\"elapsed_ms\":658896.0,\"benchmarkHostName\":\"bench-node-eu0101\",\"errors\":[],\"additionalInformation\":null}' | cat >> ~/benchresults.txt ", "delta": "0:00:00.011744", "end": "2014-09-01 10:27:22.993000", "rc": 0, "start": "2014-09-01 10:27:22.981256", "stderr": "", "stdout": ""}
{\"totalCassandraClientCalls\":100000,\"totalStatements\":10000000,\"clientCallsPerSecond\":150.63453639965792,\"statementsPerSecond\":15063.453639965794,\"meanlatency_clientCall\":37.44866236647,\"medianlatency_clientCall\":15.516015,\"ninetyFiveTh_clientCall\":187.79799799999998,\"ninetyNineTh_clientCall\":4.8996319999999995,\"elapsed_ms\":663858.0,\"benchmarkHostName\":\"bench-node-eu0102\",\"errors\":[],\"addit
@cosh
cosh / gist:85127995da16f2709809
Created September 1, 2014 11:12
cassandra cluster on google compute engine cluster
Datacenter: ZONE1
=================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 10.240.162.97 1.63 GB 256 2.0% 4f340452-bff4-4868-8f7a-be3b5e1afdb3 RAC1
UN 10.240.178.204 1.74 GB 256 2.1% c64b07c2-fb2a-4b50-ab84-814de4c6ed2a RAC1
UN 10.240.155.137 1.79 GB 256 2.2% 9cedb73c-ea1b-4b1b-9300-98bf78eb3762 RAC1
UN 10.240.159.76 1.73 GB 256 2.1% 2d20c83d-1eee-4063-a4da-4404954e3f47 RAC1
UN 10.240.83.151 1.78 GB 256 2.2% 876088a5-bc9e-41a4-83ea-8c6a9e722867 RAC1
@cosh
cosh / ddl.kql
Created July 19, 2019 07:25
DDL for prometheus to ADX
//Table for raw data and the corresponding mapping
.create table RawData (d: dynamic)
.create table RawData ingestion json mapping "RawDataMapping" '[{ "column" : "d", "datatype" : "dynamic", "path" : "$"}]'
//Table for the remote_read endpoint (optimized for quering time series and labels.
.create table SearchExplosion (ts: datetime, label: dynamic, timeseries: dynamic, value: real)
//Update policy RawData -> SearchExplosion
.create function Update_SearchExplosion()
{
@cosh
cosh / prometheus.yml
Created July 19, 2019 07:36
Remote read and write config for Prometheus
# my global config
global:
scrape_interval: 1m # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 1m # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
#connect cluster('demo12.westus.kusto.windows.net').database('Datasets')
https://demo12.westus.kusto.windows.net
// 1. Count of events, ~165M
nyc_taxi
| count
// 2. Show random pickups
@cosh
cosh / geospatial.kql
Created June 2, 2020 20:56
Sample queries for geospatial analytics on Azure Data Explorer
#connect cluster('help.kusto.windows.net').database('Samples')
//Show random storm events
StormEvents
| where isnotempty( BeginLat) and isnotempty( BeginLon)
| project BeginLon, BeginLat, EventType
| take 300
| render scatterchart with (kind = map)
//Show nearby storm events
let k = dynamic({"type":"Polygon","coordinates":[[[-68.02734375,27.137368359795584],[-65.91796875,27.059125784374068],[-65.830078125,33.797408767572485],[-61.34765625,26.980828590472107],[-58.27148437499999,27.059125784374068],[-63.6328125,34.95799531086792],[-58.18359375,42.032974332441405],[-60.46875,42.09822241118974],[-65.91796875,34.95799531086792],[-65.91796875,42.16340342422401],[-68.115234375,42.032974332441405],[-68.02734375,27.137368359795584]]]});
let u = dynamic({"type":"Polygon","coordinates":[[[-53.0859375,27.137368359795584],[-50.2734375,27.137368359795584],[-47.548828125,28.3],[-46.40625,30],[-46.142578125,42.16340342422401],[-48.33984375,42.16340342422401],[-48.7,31],[-50.009765625,29.611670115197377],[-52.64648437499999,29.38217507514529],[-53.701171875,29.611670115197377],[-55.634765625,30.600093873550072],[-55.810546875,42.16340342422401],[-57.83203125,41.96765920367816],[-58.095703125,29.7],[-56.51367187499999,28.2],[-55.37109374999999,27.7],[-53.0859375,27.137368359795584]]]});
let s = d
// Geohash GeoJSON collection
datatable(lng:real, lat:real)
[
-73.975212, 40.789608,
-73.916869, 40.818314,
-73.989148, 40.743273,
]
| project geohash = geo_point_to_geohash(lng, lat, 5)
| project geohash_polygon = geo_geohash_to_polygon(geohash)
| summarize geohash_polygon_lst = make_list(geohash_polygon)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cosh
cosh / map.geojson
Last active October 15, 2022 06:18
datatable(lng:real, lat:real)
[
-73.956683, 40.807907,
-73.916869, 40.818314,
-73.989148, 40.743273,
]
| project h3_hash = geo_point_to_h3cell(lng, lat, 6)
| project h3_hash_polygon = geo_h3cell_to_polygon(h3_hash)
| summarize h3_hash_polygon_lst = make_list(h3_hash_polygon)
| project pack(