Tutorial by Examples: ect

// Java: IntSummaryStatistics ageSummary = persons.stream() .collect(Collectors.summarizingInt(p -> p.age)); System.out.println(ageSummary); // IntSummaryStatistics{count=4, sum=76, min=12, average=19.000000, max=23} // Kotlin: // something to hold the stats... da...
Scollector binaries for Windows, Mac, and Linux are available from the Bosun release page and can be saved to /opt/scollector/ or C:\Program Files\scollector\. The Scollector configuration file uses TOML v0.2.0 to specify various settings and defaults to being named scollector.toml in the same folde...
On Windows you can install Scollector as a service using the -winsvc="install" flag. On Mac and Linux you must manually create a service or init script. For example here is a basic systemd unit file: #Scollector unit file saved to /etc/systemd/system/scollector.service [Unit] Descriptio...
#Example of a PowerShell external collector. See http://bosun.org/scollector/external-collectors for details #This file should be saved in C:\Program Files\scollector\collectors\0\mymetrics.ps1 since it is a continuous output script #scollector.toml should have ColDir = 'C:\Program Files\scollecto...
The following can be saved as main.go. After you update the EDITME settings and build the executable it can be used as a continuous external collector. package main import ( "fmt" "log" "net/url" "strconv" "time" &...
The following Go file can be compiled into a continuous external collector that will query a MSSQL server database that uses the StackExchange.Exceptional schema. It will query multiple servers/databases for all exceptions since UTC 00:00 to convert the raw entries into a counter. It also uses the b...
var wsHost = "ws://my-sites-url.com/path/to/web-socket-handler"; var ws = new WebSocket(wsHost);
5.1 .some and .every allow a logical connective of Array values. While .some combines the return values with OR, .every combines them with AND. Examples for .some [false, false].some(function(value) { return value; }); // Result: false [false, true].some(function(value) { return value...
The <section> element represents a generic section to thematically group content. Every section, typically, should be able to be identified with a heading element as a child of the section. You can use the <section> element within an <article> and vice-versa. Every section shou...
The standard (section 23.3.7) specifies that a specialization of vector<bool> is provided, which optimizes space by packing the bool values, so that each takes up only one bit. Since bits aren't addressable in C++, this means that several requirements on vector are not placed on vector<bool...
C11 Reading an object will cause undefined behavior, if the object is1: uninitialized defined with automatic storage duration it's address is never taken The variable a in the below example satisfies all those conditions: void Function( void ) { int a; int b = a; } 1 (Quo...
6 var myIterableObject = {}; // An Iterable object must define a method located at the Symbol.iterator key: myIterableObject[Symbol.iterator] = function () { // The iterator should return an Iterator object return { // The Iterator object must implement a method, next() next: func...
using System; using System.Dynamic; dynamic info = new ExpandoObject(); info.Id = 123; info.Another = 456; Console.WriteLine(info.Another); // 456 Console.WriteLine(info.DoesntExist); // Throws RuntimeBinderException
The typeof operator works on type parameters. class NameGetter<T> { public string GetTypeName() { return typeof(T).Name; } }
Example init script for scollector: #!/bin/bash # # scollector Startup script for scollector. # # chkconfig: 2345 90 60 # description: scollector is a replacement for OpenTSDB's TCollector \ # and can be used to send metrics to a Bosun server # Source function library. . /etc/init....
#Create Scollector unit file at /etc/systemd/system/scollector.service [Unit] Description=Scollector Service After=network.target [Service] Type=simple User=root ExecStart=/opt/scollector/scollector -h mybosunserver.example.com Restart=on-abort [Install] WantedBy=multi-user.target #...
Chef Scollector Cookbook: https://github.com/alexmbird/chef-scollector Chef Bosun Cookbook: https://github.com/ptqa/chef-bosun Puppet scollector module: https://github.com/axibase/axibase-puppet-modules Bosun Ansible/Vagrant example: https://github.com/gnosek/bosun-deploy
git bisect allows you to find which commit introduced a bug using a binary search. Start by bisecting a session by providing two commit references: a good commit before the bug, and a bad commit after the bug. Generally, the bad commit is HEAD. # start the git bisect session $ git bisect start ...
7 Object spreading is just syntactic sugar for Object.assign({}, obj1, ..., objn); It is done with the ... operator: let obj = { a: 1 }; let obj2 = { ...obj, b: 2, c: 3 }; console.log(obj2); // { a: 1, b: 2, c: 3 }; As Object.assign it does shallow merging, not deep merging. let obj3 = ...
In order to create a new Android HTTP Client HttpURLConnection, call openConnection() on a URL instance. Since openConnection() returns a URLConnection, you need to explicitly cast the returned value. URL url = new URL("http://example.com"); HttpURLConnection connection = (HttpURLConnect...

Page 7 of 99