To set up a minimal environment with Elasticsearch and Docker
- install Docker for your OS
- install Docker Compose (optional)
To run Elasticsearch the following docker
command uses the official Docker image. Open your terminal and run:
/// Prints the heart rate zones assuming a 5 zones distribution with | |
/// simple ranges. Adjust to your liking. | |
fn print_zones(resting_heart_rate: u16, max_heart_rate: u16) { | |
let zones = [(50, 60), (60, 70), (70, 80), (80, 90), (90, 100)]; | |
let heart_rate_reserve = max_heart_rate - resting_heart_rate; | |
for (index, (lower, upper)) in zones.iter().enumerate() { | |
let lower = resting_heart_rate + heart_rate_reserve * lower / 100; | |
let upper = resting_heart_rate + heart_rate_reserve * upper / 100; |
{ | |
"format_version": 1, | |
"package_id": "path+file:///Users/sziebell/dev/temp/axum/axum-core#0.4.3", | |
"name": "axum-core", | |
"version": "0.4.3", | |
"source": "/Users/sziebell/dev/temp/axum/axum-core", | |
"target": { | |
"kind": [ | |
"lib" | |
], |
To set up a minimal environment with Elasticsearch and Docker
To run Elasticsearch the following docker
command uses the official Docker image. Open your terminal and run:
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"defaultProfile": "{2c4de342-38b7-51cf-b940-2309a097f518}", | |
"profiles": |
Example stack trace in Ruby
divide_by_zero.rb:2:in `/': divided by 0 (ZeroDivisionError)
from divide_by_zero.rb:2:in `divide'
from divide_by_zero.rb:5:in `<main>'
The following analyzer is a first draft of how to split / analyze the stack trace. The user should be able to search for file name, line number, exception. Only the first two lines of the stack trace are analyzed.
This setup shows how to use a percolator query, for more details see Percolator Query documentation.
The following setup was tested with Elasticsearch 6.5.
Create a new index with a given mapping, the document only accepts a message
field
curl -X PUT 'http://localhost:9200/percolator' -H 'Content-Type: application/json' -d '{
# class to test behaviour of Proc and to_proc | |
class ProcTest | |
def initialize(text='') | |
@text = text | |
end | |
def say | |
puts "say #{text}" | |
end |
HOSTS: | |
centos-7-x64-master: | |
roles: | |
- master | |
- agent | |
platform: el-7-x86_64 | |
hypervisor: vagrant | |
box: puppetlabs/centos-7.2-64-nocm | |
vagrant_memsize: 2048 # increase memory or OutOfMemoryError will occur | |
vagrant_cpus: 2 # to speed things up a little |
# put the following content into ~/.vagrant/Vagrantfile | |
# install plugin vagrant-proxyconf: vagrant plugin install vagrant-proxyconf | |
VAGRANTFILE_API_VERSION = "2" | |
def get_proxy_url | |
# Doesn't support different proxies for different protocols at present | |
host_proxy = ENV['http_proxy'] || ENV['HTTP_PROXY'] || ENV['https_proxy'] || ENV["HTTPS_PROXY"] | |
if host_proxy | |
uri = URI(host_proxy) |