This repository contains a docker-compose file which can be used to setup a demo of the M3 stack. It runs the following containers:
- M3DB
- M3Coordinator
- Prometheus
- Grafana
| package valuepack | |
| import ( | |
| "container/list" | |
| "fmt" | |
| ) | |
| type value struct { | |
| metadata ValueMetadata | |
| elem interface{} |
| package main | |
| import ( | |
| "fmt" | |
| "sync" | |
| "sync/atomic" | |
| ) | |
| const ( | |
| offset64 = 14695981039346656037 |
| # originally courtesy of https://gist.github.com/pkuczynski/8665367 | |
| # note: only supports 2 space indented YAML. | |
| # additions: | |
| # - only set environment variable if not already set | |
| # - uppercase parsed variables to avoid case sensitivity | |
| parse_yaml() { | |
| local prefix=$2 | |
| local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') | |
| sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ | |
| -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | |
| metrics: | |
| prometheus: | |
| handlerPath: /metrics | |
| timerType: histogram | |
| sanitization: prometheus | |
| samplingRate: 1.0 | |
| extended: detailed |
| // Copyright 2016 Prometheus Team | |
| // Licensed under the Apache License, Version 2.0 (the "License"); | |
| // you may not use this file except in compliance with the License. | |
| // You may obtain a copy of the License at | |
| // | |
| // http://www.apache.org/licenses/LICENSE-2.0 | |
| // | |
| // Unless required by applicable law or agreed to in writing, software | |
| // distributed under the License is distributed on an "AS IS" BASIS, | |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| --- | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| labels: | |
| app: coordinator | |
| name: coordinator-dedicated | |
| spec: | |
| ports: | |
| - name: coordinator |
| #!/bin/bash | |
| echo "Example usage: KV_ZONE=embedded KV_ENV=default_env COORD_HTTP_HOST=\"host1\" COORD_HTTP_PORT=\"7201\" HOSTS=\"host1 host2 host3\" ISOLATION_GROUP=\"group\" ./m3dbops-nodes-add.sh" | |
| if [ "$HOSTS" = "" ]; then | |
| echo "must set HOSTS" | |
| exit 1 | |
| fi | |
| if [ "$ISOLATION_GROUP" = "" ]; then |