brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikezaccardo <...@git.apache.org>
Subject [GitHub] brooklyn-docs pull request #160: Add separate enrichers page and combine pol...
Date Mon, 10 Apr 2017 19:09:19 GMT
Github user mikezaccardo commented on a diff in the pull request:

    https://github.com/apache/brooklyn-docs/pull/160#discussion_r110738634
  
    --- Diff: guide/java/enrichers.md ---
    @@ -0,0 +1,150 @@
    +---
    +title: Enrichers
    +layout: website-normal
    +toc: ../guide_toc.json
    +categories: [use, guide, defining-applications]
    +---
    +
    +Enrichers provide advanced manipulation of an entity's sensor values.
    +
    +#### Transformer
    +
    +- org.apache.brooklyn.enricher.stock.Transformer
    +
    +Transforms attributes of an entity.
    +
    +{% highlight yaml %}
    +brooklyn.enrichers:
    +- type: org.apache.brooklyn.enricher.stock.Transformer
    +  brooklyn.config:
    +    enricher.sourceSensor: $brooklyn:sensor("urls.tcp.string")
    +    enricher.targetSensor: $brooklyn:sensor("urls.tcp.withBrackets")
    +    enricher.targetValue: $brooklyn:formatString("[%s]", $brooklyn:attributeWhenReady("urls.tcp.string"))
    +{% endhighlight %}
    +
    +#### Propagator
    +
    +- org.apache.brooklyn.enricher.stock.Propagator
    +
    +Use propagator to duplicate one sensor as another, giving the supplied sensor mapping.
    +The other use of Propagator is where you specify a producer (using `$brooklyn:entity(...)`
as below)
    +from which to take sensors; in that mode you can specify `propagate` as a list of sensors
whose names are unchanged,
    +instead of (or in addition to) this map
    +
    +{% highlight yaml %}
    +brooklyn.enrichers:
    +- type: org.apache.brooklyn.enricher.stock.Propagator
    +  brooklyn.config:
    +    producer: $brooklyn:entity("cluster")
    +- type: org.apache.brooklyn.enricher.stock.Propagator
    +  brooklyn.config:
    +    sensorMapping:
    +      $brooklyn:sensor("url"): $brooklyn:sensor("org.apache.brooklyn.core.entity.Attributes",
"main.uri")
    +{% endhighlight %}
    +
    +####	Custom Aggregating
    +
    +- org.apache.brooklyn.enricher.stock.Aggregator
    +
    +Aggregates multiple sensor values (usually across a tier, esp. a cluster) and performs
a supplied aggregation method to them to return an aggregate figure, e.g. sum, mean, median,
etc.
    +
    +{% highlight yaml %}
    +brooklyn.enrichers:
    +- type: org.apache.brooklyn.enricher.stock.Aggregator
    +  brooklyn.config:
    +    enricher.sourceSensor: $brooklyn:sensor("webapp.reqs.perSec.windowed")
    +    enricher.targetSensor: $brooklyn:sensor("webapp.reqs.perSec.perNode")
    +    enricher.aggregating.fromMembers: true
    +    transformation: average
    +{% endhighlight %}
    +
    +#### Joiner
    +
    +- org.apache.brooklyn.enricher.stock.Joiner
    +
    +Joins a sensor whose output is a list into a single item joined by a separator.
    +
    +{% highlight yaml %}
    +brooklyn.enrichers:
    +- type: org.apache.brooklyn.enricher.stock.Joiner
    +  brooklyn.config:
    +    enricher.sourceSensor: $brooklyn:sensor("urls.tcp.list")
    +    enricher.targetSensor: $brooklyn:sensor("urls.tcp.string")
    +    uniqueTag: urls.quoted.string
    +{% endhighlight %}
    +
    +####	Delta Enricher
    +
    +- org.apache.brooklyn.policy.enricher.Delta Enricher
    +
    +Converts absolute sensor values into a delta.
    --- End diff --
    
    TODO


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message