Merge branch 'dev-dstryker' into collector-ng
Merge branch 'collector-ng' of github.com:ning/Arecibo into collector-ng
Fix definitional issue in aggregation loop: should loop while < aggregationLevel, not while < aggregationLevel - 1
Revert "Fix definitional issue in aggregation loop: should loop while < aggregationLevel, not while < aggregationLevel - 1"

The right way to fix this is a gepo property change to increase the max aggregation level, not changing the loop.

This reverts commit dc15930b3d4f9c1a17a00176894d4623e31928e9.
This checkin improves the indexes used by timeline aggregation.

collector/src/main/java/com/ning/arecibo/collector/guice/CollectorConfig.java:

    Change the default timeline length from 10 minutes to 60 minutes.

    Add parameter saying whether aggregation is enabled.

collector/src/main/java/com/ning/arecibo/collector/persistent/TimelineAggregator.java:

    Change interpretation of aggregation levels to be more
    self-consistent.

    Fix bug: don't try to aggregate if there are no chunks.

collector/src/main/resources/collector.sql:

    Improve the indexes used for aggregation on timeline_times and
    timeline_chunks.

collector/src/main/resources/com/ning/arecibo/collector/persistent/TimelineAggregatorDAO.sql.stg:

    When getting sample chunks to aggregate, order by start_time, not
    timeline_times_id.

util/src/main/resources/com/ning/arecibo/util/timeline/persistent/TimelineDAOQueries.sql.stg

    Whitespace fix.
util: fix getEventCategoryIdAndSampleKind query

Add missing SQL and mapper for CategoryIdAndSampleKind.

I've also added a unit test for it in TestDefaultTimelineDAO.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
Merge branch 'collector-ng' of github.com:ning/Arecibo into collector-ng
util: introduce CategoryAndSampleKinds

CategoryAndSampleKinds captures all sample kinds for a given category.
This new POJO is used by the dashbaord.

Update the collector client library to return it for all sample kinds
calls.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
dashboard: initial prototype

A new page at http://127.0.0.1:8080/static/arecibo.html
will prompt the user for the type of data to graph.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
collector: update /host_samples endpoint for the dashboard

Before, the endpoint was returning:

[ {
  "hostId" : 8,
  "sampleKindId" : 2900,
  "samplesAsCSV" : "..."
} ]

The id are useless for the dashboard. Instead, return:

[ {
  "hostName" : "box.company.com",
  "eventCategory" : "ActiveMQBroker_localhost",
  "sampleKind" : "TotalConsumerCount",
  "samples" : "..."
} ]

Note that we still pass CSV samples to the dashboard. We should change it to pass
the compressed timeline times and data ("compact view") to speed up data retrieval.
Most of the wiring is there and the decompression methods are shared (util submodule).

I've also updated the collector client to use the /host_samples endpoint exclusively.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
collector-client-support: fix typo in DefaultCollectorClient

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
collector-client-support: fix getHostSamplesAsStream call

Add missing category_and_sample_kind parameters.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
dashboard: iteration on landing page

Use local storage to save the start and end times.
We should also consider turning on persistence for the two checkbox
trees.

Integrate with the graphing page by making the Graph button redirect
with the right query parameters.

Hide more icons in the checkbox trees.

Extract common code in js/utils.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
collector-client-support: fix another typo in DefaultCollectorClient

A call to .getSamples() was missing when merging the samples.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
dashboard: add graph.html page

The graph.html page takes care of the rendering.

The url structure is identical to the host_samples resource
which should give us access to the raw data as well as
permalinks/bookmarks for free.

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
Greatly reduce launcher.log pollution by changing log.info() calls to log.debug(), in TimelineAggregator and TimelineEventHandler
Add a bunch more TimelineAggregator counters and machinery to report on changes for each aggregation level
dashboard: unify lighthouse advertisement with collector code

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
dashboard: warn the user if no time range was specified

Reported-by: David Stryker <dstryker@ning.com>
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>
dashboard: fix arecibo.html page on Firefox

Make sure to call initializeUI() first for non-Webkit browsers.

Reported-by: David Stryker <dstryker@ning.com>
Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>