- @uzulla さん
安定の楽しさ!
安定の楽しさ!
| # prerequisites | |
| # ubuntu + docker + docker-machine + digital ocean cloud | |
| -- create a docker host for jmeter-server | |
| JMETER_SERVER_ID=1 | |
| docker-machine create --driver digitalocean --digitalocean-access-token $DOTOKEN jmeter-server${JMETER_SERVER_ID} | |
| -- create a docker host for jmeter-client | |
| docker-machine create \ | |
| --driver digitalocean \ |
| >>> import itertools | |
| >>> import string | |
| >>> from elasticsearch import Elasticsearch,helpers | |
| es = Elasticsearch() | |
| >>> # k is a generator expression that produces | |
| ... # a series of dictionaries containing test data. | |
| ... # The test data are just letter permutations | |
| ... # created with itertools.permutations. | |
| ... # | |
| ... # We then reference k as the iterator that's |
| require "nokogiri" | |
| require "open-uri" | |
| site_uri = "http://status.aws.amazon.com" | |
| html = Nokogiri::HTML(open site_uri) | |
| feed_uris = html.css("a[href$=rss]").map do |node| | |
| site_uri + node.attributes["href"].value | |
| end |
| #!/usr/bin/env ruby | |
| require 'net/http' | |
| require 'uri' | |
| require 'json' | |
| require 'pp' | |
| consul_url = 'http://localhost:8500/v1/catalog' | |
| output = {} | |
| s_json = JSON.parse(Net::HTTP.get_response(URI.parse("#{consul_url}/services")).body) |
| # Initialize the scroll | |
| page = es.search( | |
| index = 'yourIndex', | |
| doc_type = 'yourType', | |
| scroll = '2m', | |
| search_type = 'scan', | |
| size = 1000, | |
| body = { | |
| # Your query's body | |
| }) |
| source 'https://rubygems.org' | |
| gem 'fluentd' | |
| gem 'fluent-plugin-td' | |
| gem 'fluent-plugin-elasticsearch' |
| import requests | |
| from checks import AgentCheck | |
| class ConsulCheck(AgentCheck): | |
| def should_check(self): | |
| r = requests.get(self.init_config["consul_url"] + "/v1/agent/self") | |
| if r.status_code != 200: | |
| return False | |
| agent = r.json() |