Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Jon Schneider jkschneider

🏠
Working from home
Block or report user

Report or block jkschneider

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View NonBlockingLoadTest.java
WebClient client = WebClient.builder()
.baseUrl("http://" + args[0])
.build();
Flux
.generate(AtomicLong::new, (state, sink) -> {
long i = state.getAndIncrement();
sink.next(i);
return state;
})
@jkschneider
jkschneider / SpinnakerMetricsConfiguration.java
Last active Oct 10, 2019
Spring Boot configuration to wire Spinnaker K8S v2 Provider annotations to Micrometer for use in Kayenta
View SpinnakerMetricsConfiguration.java
@Configuration
public class PaneraMetricsAutoConfiguration {
private final Logger logger = LoggerFactory.getLogger(PaneraMetricsAutoConfiguration.class);
@Value("${spring.application.name:unknown}")
private String appName;
@Value("${HOSTNAME:unknown}")
private String host;
@jkschneider
jkschneider / dependency-problems.md
Created Sep 19, 2019
Classes of dependency problems
View dependency-problems.md

API utilization

Guava famously deprecates in one minor release and removes deprecations in the next, but it isn't uncommon to see Guava version divergences greater than two minor releases in a large dependency graph in application code. Latest or nearest version conflict resolution both lead to breaking consequences because different parts of the dependency graph make different assumptions.

Semantic incompatibility leads to a similar problem as the Guava problem.

Developers on core libraries or organization-wide curators of third-party dependencies may wish to peek at API utilization to determine the impact of an impending change.

Security teams may wish to peek at API utilization to determine where known vulnerable methods are in use.

@jkschneider
jkschneider / spinnaker-local.yml
Created Jun 7, 2019
Spinnaker config with CloudFoundry, Jenkins, Artifactory
View spinnaker-local.yml
# This file is intended to serve as a master configuration for a Spinnaker
# deployment. Customizations to the deployment should be made in another file
# named "spinnaker-local.yml". The distribution has a prototype called
# "default-spinnaker-local.yml" which calls out the subset of attributes of
# general interest. It can be copied into a "spinnaker-local.yml" to start
# with. The prototype does not change any of the default values here, it just
# surfaces the more critical attributes.
global:
View app.json
{
"userId": 1,
"id": 1,
"title": "delectus aut autem",
"completed": false
}
@jkschneider
jkschneider / metricsdemo-atherton.yml
Last active Apr 3, 2019
A series of manifests for testing Spinnaker CF integration.
View metricsdemo-atherton.yml
---
applications:
- name: metricsdemo
routes:
- route: metricsdemo.apps.atherton.cf-app.com
@jkschneider
jkschneider / build.gradle
Created Mar 7, 2019
Gradle publishing to artifactory
View build.gradle
plugins {
id 'java'
id 'com.jfrog.artifactory' version '4.9.0'
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'io.spring.dependency-management' version '1.0.7.RELEASE'
id 'nebula.maven-publish' version '9.5.0'
id 'nebula.release' version '9.2.0'
id 'nebula.info' version '5.0.0'
}
@jkschneider
jkschneider / StatsdConfiguration.java
Created Feb 15, 2019
How to send StatsD metrics over AMQP
View StatsdConfiguration.java
@Bean
StatsdMeterRegistry statsdMeterRegistry(StatsdConfig config) {
return StatsdMeterRegistry.builder(config)
.lineSink(line -> {
// send this line to AMQP with your broker's client library
})
.build();
}
@jkschneider
jkschneider / scratch.java
Created Jan 30, 2019
Wiring for Datadog in Spring MVC
View scratch.java
@Bean
MeterRegistry registry() {
MeterRegistry registry = new DatadogMeterRegistry(new DatadogConfig() {
@Override
public String apiKey() {
return "";
}
@Override
public String applicationKey() {
View spinnaker-test-times.json
{"name":"tests","children":[{"name":"clouddriver-google-common","children":[{"name":"com.netflix.spinnaker.clouddriver.googlecommon.deploy.GoogleCommonSafeRetrySpec","children":[{"name":"should retry on certain error codes[0]","size":727},{"name":"should retry on certain error codes[1]","size":0},{"name":"should retry on certain error codes[2]","size":1},{"name":"should retry on certain error codes[3]","size":1},{"name":"should retry on certain error codes[4]","size":1},{"name":"no_retry","size":1094},{"name":"retry_until_success","size":257},{"name":"retry_until_exhausted","size":22},{"name":"retry_until_404_ok","size":10},{"name":"retry_until_404_not_ok","size":7}]}]},{"name":"clouddriver-security","children":[{"name":"com.netflix.spinnaker.clouddriver.security.DefaultAccountCredentialsProviderSpec","children":[{"name":"should call repo to retrieve objects","size":772}]},{"name":"com.netflix.spinnaker.clouddriver.security.DefaultAllowedAccountsValidatorSpec","children":[{"name":"should reject if allowed acc
You can’t perform that action at this time.