Skip to content

Instantly share code, notes, and snippets.

View sriumcp's full-sized avatar

Srinivasan Parthasarathy sriumcp

View GitHub Profile
@sriumcp
sriumcp / informer.go
Created November 21, 2022 16:23
Attempt at AutoX informer
func newIter8Watcher(autoXConfig config) *iter8Watcher {
w := &iter8Watcher{
factories: map[string]dynamicinformer.DynamicSharedInformerFactory{},
}
// aggregate all triggers (namespaces and GVR) from the releaseGroupConfig
// triggers map has namespace as its key and the object GVRs within the namespace that it is watching as its value
triggers := map[string][]schema.GroupVersionResource{}
for _, releaseGroupSpec := range autoXConfig.Specs {
@sriumcp
sriumcp / name.json
Last active April 11, 2022 02:42
Iter8 data and metadata url
{
"name": "Iter8 user"
}
@sriumcp
sriumcp / kubecon
Last active April 5, 2021 04:20
Kubecon metrics-mock config
- provider: newrelic
uri: /newrelic
versions:
- params:
- name: nrql
value: "SELECT average\\(duration\\) FROM Sessions WHERE version='v1' SINCE .* sec ago\n"
metric:
type: gauge
shift: 5
multiplier: 10
@sriumcp
sriumcp / uriconfs.yaml
Last active March 10, 2021 00:03
URIConf
- provider: Prometheus # this URI will generate metrics in Prometheus response format
uri: /promcounter # do not use / for the uri; will lead to unexpected bad things; also make sure URIs are unique
# every query to this URI needs to have the following headers
headers:
user: abcd
pass: efgh
# this URI will generate metrics for the following versions
versions:
- params: # params for version 1 should match the following;
- name: query
@sriumcp
sriumcp / universalexperiment.yaml
Last active September 17, 2020 13:25
Universal Experiment CR for canary release. Backend = k8s + Istio. Entity-version = service-deployments
apiVersion: iter8.tools/v1alpha1
kind: UniversalExperiment
# Experiment with any kubernetes entity and its versions on any kubernetes backend.
# Some examples of backends, entities, and versions that are supported are as follows.
# CR in this example focuses on item #2 in the list.
# 1. Backend = k8s. Entity-version = service-deployments
# 2. Backend = k8s + Istio. Entity-version = service-deployments
# 3. Backend = k8s + SMI. Entity-version = service-deployments
# 4. Backend = k8s + linkerd. Entity-version = service-deployments
# 5. Backend = k8s + Gloo. Entity-version = service-deployments. Note: Gloo itself can use multiple backends.
{
"version": "0.7.0",
"app": {
"_id": "jetLpRfQ3BCRGiMxe",
"userId": "guest",
"name": "Sample",
"private": false,
"selectedDashboardId": "ruHbJhctjLhCYZiof"
},
"dashboards": [
@sriumcp
sriumcp / gist:4fbd7d1b5def78bfa681c72866954cd2
Last active December 1, 2016 19:59
Sample READ Application for Streams developers getting started with READ: https://github.com/IBMStreams/streamsx.visualization
{
"version": "0.7.0",
"app": {
"_id": "Q4EnorTFxvG9gyHyB",
"userId": "guest",
"name": "Time Series",
"private": true,
"selectedDashboardId": "7kGXWA8K4yM55PCji"
},
"dashboards": [
[
1.1693609877053437,
2.414213562373091,
5,
-4.182662140446601,
-1.6307015302148402,
-0.8551679169341168,
-0.4149498750489046,
-0.07965009291617457,
0.2394143257845769,
@sriumcp
sriumcp / READ.spl
Last active November 29, 2016 17:14
SPL Sample Application for Streams Developer getting started on READ
namespace application ;
use com.ibm.streamsx.inet.rest::HTTPTupleView ;
use com.ibm.streamsx.inet.wsserver::WebSocketSend ;
/* This SPL application creates a data stream called 'time', and provides
* three different ways of accessing it via READ */
composite Main
{
@sriumcp
sriumcp / For Rob
Created October 28, 2016 16:50
Bunch of code snippets related to socket.io and Rx (totally untested)
/* Code to initialize the socket -- uses socket.io events; */
let socket = io.connect('http://sockethost:socketport');
/* A thin wrapper to convert socket.io events to Rx events */
/* This piece of code ensures that when there is new data on the socket, that data gets pushed as a new message onto the dataStream,
which is really an Rx.Observable */
/* dataStream responds to 'data' events on the socket */
let dataStream = Rx.Observable.fromEventPattern(
function addHandler(dataHandler) {