Fork me on GitHub
#clojure-uk
<
2016-05-12
>
agile_geek06:05:36

Ay up UK...anyone out there?

agile_geek06:05:50

BTW anyone using Riemann to monitor microservices?

dharrigan08:05:48

arrgh! it doesn't backfill

gjnoonan09:05:42

I use Riemann @agile_geek amongst others(don't ask)

martintrojer09:05:32

i'm a logstash man

gjnoonan09:05:58

I also use logstash for logging...

gjnoonan09:05:23

Datadog also, but evaluating sysdig cloud

agile_geek09:05:39

@gjnoonan: @martintrojer I don't think they are mutually exclusive. I would use both

agile_geek09:05:03

I have no way of using Riemann on my current client but was thinking about how to monitor/manage microservices if I ever manage to do something of my own and wanted to know pros/cons

gjnoonan09:05:53

Indeed, although there are many different tools in play at the moment, I am trying to unify things.

dharrigan10:05:28

lots of pretty graphs and metrics

martintrojer10:05:26

the de-bouncing, send-to-pagerduty etc that (some) people use riemann for I do in logstash

martintrojer10:05:37

logstash is more than ingesting logs into elasticsearch

martintrojer10:05:32

for pure metrics, i'd vote datadog.

dharrigan10:05:34

All written using Erlang afaik.

dharrigan10:05:12

disclosure: I know someone there, but have never used their services.

martintrojer10:05:46

oh, I only use services written in perl.

dharrigan10:05:07

I don't know if you're serious or joking simple_smile

dharrigan10:05:33

I invoke Poe's Law.

martintrojer10:05:20

all I say is a joke.

dharrigan10:05:29

arrah that's worse

dharrigan10:05:39

it's like "Everything I tell you is a lie"

martintrojer10:05:04

so, Github really screwed over most startups

martintrojer10:05:19

Take my advice, buy Gitlab shares

martintrojer10:05:40

Even more advice;

martintrojer10:05:48

Keep only open repos on GH

martintrojer10:05:09

move private stuff to gitlab hosted on a t2.nano

dharrigan10:05:42

Why did they screw over?

martintrojer10:05:34

10x monthly spend

martintrojer10:05:43

(for all those 10x devs out there)

afhammad10:05:39

Quite happy with Bitbucket, we have dozens of repos on there

dharrigan10:05:41

Do you find bitbucket slow?

martintrojer10:05:38

well, bitbucket has the same per-user license as neo-github. so that wont fly

gjnoonan11:05:13

newrelic are aweful IMO, added a load of overhead too

gjnoonan11:05:41

we run both bitbucket and gitlab at the moment, much prefer gitlab

gjnoonan11:05:51

will be transitioning everything over

glenjamin11:05:20

I don’t see how github changes should affect startups much? Client-services companies I’d expect to be hardest hit

dharrigan11:05:22

A question. I'm attempting to override a Java class. I have my gen-class, extends and exposes set. In the function which overrides (the protected method of the java class), I have something like this:

dharrigan11:05:42

(defn -getForegroundColorCode
  [this event]
  (condp = (event getLevel)
    Level/ERROR_INT (str ANSIConstants/BOLD ANSIConstants/RED_FG)))

dharrigan11:05:06

(the function is incomplete, so ignore the fact that condp doesn't have a default...)

dharrigan11:05:48

I'm puzzled and not sure. "event" has a type (ILoggingEvent) with a method called getLevel

dharrigan11:05:10

1. do I have to tell clojure somehow about this type (a cast to ILoggingEvent?),

dharrigan11:05:27

2. will the event getLevel do what I want it to do?

dharrigan11:05:09

This is the protected method I'm attempting to learn how to override:

dharrigan11:05:14

protected abstract String getForegroundColorCode(E var1);

dharrigan11:05:08

I throw myself at the mercy of this wisened crowd.

minimal11:05:56

don’t you want (.getLevel event) ?

dharrigan11:05:20

Indeed I do, indeed I do

dharrigan11:05:34

bah! postfix

dharrigan11:05:42

still making mistakes simple_smile

minimal11:05:39

🙂 repl is your friend

glenjamin11:05:42

you can typehint to remove reflection, but it’ll work without the typehint

dharrigan11:05:56

Does Clojure support generic types from Java?

dharrigan11:05:10

(yup, I know everything is erased...)

dharrigan11:05:38

But can you put into the "extends" of a gen-class that this type also has this generic type?

dharrigan11:05:07

(or should I not worry my tiny brain about such things?)

glenjamin11:05:23

generics only exist in javac, which clojure never deals with

glenjamin11:05:52

so no, you just have to use the collection as the type

gjnoonan12:05:35

@dharrigan: re running gitlab in a jail.. awesome. I do similar but run in a SmartOS zone 🙂

martintrojer12:05:56

look at all you OS hipsters

gjnoonan12:05:06

my Desktop at home currently consists of a thin client running NixOS with, resources provisioned from my SmartOS server

glenjamin12:05:51

I’m better with limericks

glenjamin12:05:02

> when I try to use java from clojure > it's easy to lose my composure > there's plenty more dots > and some I forgot > which then made my program fall over

dharrigan17:05:30

managed to get my clojure code to override a java method

dharrigan17:05:33

learnt a lot

dharrigan17:05:48

i.e., prefixes and why you shouldn't leave home without them

dharrigan17:05:05

using condp in a str function (functions upon functions...just like inception)

dharrigan17:05:31

and then figuring out that cursive-ide doesn't recompile AOP classes unless you force it.

dharrigan17:05:46

and the killer

dharrigan17:05:18

thou seems to have to pass in "this" into the function of the overridden method

dharrigan17:05:38

even although, the method only takes one param, you have to use [this blah]

dharrigan17:05:44

that took a while to figure out

benedek18:05:58

dharrigan: link if code is public?

dharrigan19:05:15

There you go.

dharrigan19:05:25

Simple, but functional

agile_geek19:05:03

@dharrigan: the passing this in becomes more obvious if you think of the fact that the method in the Java world has to have an instance to be called on. So in Java interop we can write (.toUpperCase "hello"). Then if you think about the .toUpperCase as a fn it's taking as it's 'target' the String "hello". This translates to "hello".toUpperCase() in Java land.

agile_geek19:05:27

So the this in the protocol is the target object itself. If that makes sense?

dharrigan19:05:41

It does, it's a rule to learn. However, documentation to explain that wasn't very forthcoming.

dharrigan19:05:55

Unless my google-fu was letting me down.

glenjamin23:05:18

the examples on clojuredocs are usually a good place to look: http://clojuredocs.org/clojure.core/gen-class