Skip to content

Instantly share code, notes, and snippets.

Mike! mike-ensor

Block or report user

Report or block mike-ensor

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 README.md

Overview

This is a quick "how-to" built off of several other's blogs, twitter posts, gists and such. The goal is to create a workable environment for basic GCP (gcloud) development with VSCode.

Note

This installation process takes about 30-45 minutes each time a container is built from scratch (purely based on network performance, so could be faster or slower, this was my experience).

Steps

  1. Enable chromebook for development (https://github.com/lstoll/cros-crostini/blob/master/README.md)
  2. Run the script (vscode-gcloud-chromebook.sh) to setup VSCode + GCloud
  3. Create service account
@mike-ensor
mike-ensor / run-benchmark-tests.sh
Created Dec 29, 2016
This script will run benchmark tests in isolation.
View run-benchmark-tests.sh
mvn clean verify -Pbenchmark
View pom.xml
<profile>
<id>benchmark</id>
<properties>
<maven.test.ITests>true</maven.test.ITests>
</properties>
<build>
<plugins>
<!-- Start application for benchmarks to test against -->
<plugin>
<groupId>org.springframework.boot</groupId>
View SerializationBenchmark.java
@State(Scope.Benchmark)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public class SerializationBenchmark {
private RecipeService service;
private Recipe recipe;
private byte[] protoRecipe;
private String recipeAsJSON;
View BenchmarkBase.java
@SpringBootApplication
public class BenchmarkBase {
public static void main(String[] args) throws RunnerException, IOException {
Properties properties = PropertiesLoaderUtils.loadAllProperties("benchmark.properties");
int warmup = Integer.parseInt(properties.getProperty("benchmark.warmup.iterations", "5"));
int iterations = Integer.parseInt(properties.getProperty("benchmark.test.iterations", "5"));
int forks = Integer.parseInt(properties.getProperty("benchmark.test.forks", "1"));
@mike-ensor
mike-ensor / pom.xml
Last active Dec 29, 2016
add-jmh-dependencies
View pom.xml
<dependencies>
<!-- Other libraries left out for brevity -->
<!-- jmh.version is the lastest version of JMH. Find by visiting
http://search.maven.org -->
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>${jmh.version}</version>
<scope>test</scope>
</dependency>
View colorize-maven.sh
#!/bin/sh
# Written by Mike Ensor (mike@ensor.cc)
# Copywrite 2012
# Use as needed, modify, have fun!
# This is intended to be used for Maven3 + Mac OSX
#
# To use:
# in your ".bashrc" or ".bash_profile" add the following line:
# source ~/<path to script>/colorize-maven.sh
You can’t perform that action at this time.