Skip to content

Instantly share code, notes, and snippets.

View ahgittin's full-sized avatar

Alex Heneveld ahgittin

View GitHub Profile
@ahgittin
ahgittin / SampleMonitorEntity.java
Last active August 29, 2015 14:07
SampleMonitorEntity
package io.cloudsoft.ibm.mms.amp.util;
import brooklyn.config.ConfigKey;
import brooklyn.enricher.Enrichers;
import brooklyn.entity.basic.AbstractEntity;
import brooklyn.entity.basic.Attributes;
import brooklyn.entity.basic.ConfigKeys;
import brooklyn.event.AttributeSensor;
import brooklyn.event.basic.Sensors;
import brooklyn.event.feed.http.HttpFeed;
cat > index.html << --EOF--
<html><body>
<h1>Hello World</h1>
<p>
This is a sample Brooklyn-deployed web server, built on netcat.
Of course you can use any script here, or pre-built blueprints for common webapp, nosql, message software,
services, clusters, or a pre-built imageId, or Chef -- up to you.
</p>
<p>
Management policies can then be mixed in.
@ahgittin
ahgittin / gist:9934210
Created April 2, 2014 13:33
brooklyn 070-snapshot oome info
Hosted AMP in SL running no blueprints currently, but previously deploying OG to SL and AWS
num #instances #bytes class name
----------------------------------------------
1: 5798577 185554464 java.util.concurrent.ConcurrentHashMap$HashEntry
2: 5403795 172921440 java.lang.String
3: 1431659 84584664 [C
4: 1528111 67764056 [Ljava.util.concurrent.ConcurrentHashMap$HashEntry;
5: 1528111 61124440 java.util.concurrent.ConcurrentHashMap$Segment
@ahgittin
ahgittin / gist:8736763
Created January 31, 2014 17:14
dse-cassandra-blueprint.yaml
name: dse-cassandra
# starts a single datacenter DSE cluster and an opscenter node
services:
- type: io.cloudsoft.datastax.dse.DSECassandraDatacenter
name: DSE Cluster
brooklyn.config:
cluster.initial.size: 5
cluster.initial.quorumSize: 3
datastax.cassandra.opscenter.entity: $brooklyn:component("opscenter")
@ahgittin
ahgittin / 1 vitaminder (based on mine, gil's, derek's, then mine again)
Last active December 18, 2015 12:49
CAMP PDP sketching after v4 and before the fruits
name: VitaMinder
artifacts:
-
name: VitaMinder WAR
type: com.example.java:WAR
content: { href: vitaminder.war }
requirements:
-
type: HostedOn
fulfillment: id:as
@ahgittin
ahgittin / jetty-spring.xml
Created June 13, 2013 10:47
Additional lines to insert into OpenGamma jetty-spring.xml to enable the Jetty MX bean. http://forums.opengamma.com/forum/discussion/comment/743
<bean id="standardMBeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
<property name="locateExistingServerIfPossible" value="true" />
</bean>
<bean id="jettyJMXExporter" class="org.springframework.jmx.export.MBeanExporter">
<property name="beans">
<map>
<entry key="com.opengamma.jetty:service=HttpConnector" value-ref="connector" />
<entry key="com.opengamma.jetty:service=HttpServer" value-ref="server" />
</map>
[
{
"type" : "DeploymentPlan"
"href" : "data://...",
},
{
"type" : "Requirement",
"id" : "file1",
"href" : "data://...",
},
@ahgittin
ahgittin / 0-three-tier-as-yaml.txt
Last active December 15, 2015 19:29
playing with Oasis CAMP PDP syntax
# yaml variant, similar to #3 below, with an explicit load balancer
# this format makes it much easier for mortals to read and write,
# based significantly on https://wiki.openstack.org/wiki/Heat/DSL
name: "Hello WebApp Cluster with Database"
components:
# key here equivalent to supplying a map with this as the value for key 'id'
hello_war:
content: hello.war
requires:
- type: com.example.java:WarDeploymentRequirement # explicit req type says to "deploy"
@ahgittin
ahgittin / MapRSyntaxPlaying.java
Created April 2, 2013 19:45
experimenting with syntax for creating MapR clusters
public class NewMapRSyntaxPlaying {
{
// 0.5.0-rc.1
// option 1 -- clusters with spec
// core = addChild(cluster(
@ahgittin
ahgittin / EntityAddChildSyntaxSnippet.java
Last active December 15, 2015 04:50
simplifying entity/app construction API
// current syntax
MySqlNode mysql = (MySqlNode) addChild(
getEntityManager().createEntity(
BasicEntitySpec.newInstance(MySqlNode.class)
.configure(MySqlNode.CREATION_SCRIPT_URL, getConfig(DB_SETUP_SQL_URL))) );
// step 1 (uncontroversial?): allow addChild to take a spec directly
MySqlNode mysql1 = (MySqlNode) addChild(
BasicEntitySpec.newInstance(MySqlNode.class)
.configure(MySqlNode.CREATION_SCRIPT_URL, getConfig(DB_SETUP_SQL_URL)) );