compaction history chart duration

21 views
Skip to first unread message

郭冬冬

unread,
Mar 31, 2014, 4:29:41 AM3/31/14
to hannib...@googlegroups.com
hi, I'm using hannibal in a product environments, when I met a problem that in compaction history chart  /compactions, the chart only show compactions of last 24 hour, I want that to be longer.
Is there any configurations that could help this problem?

ps: I already set  "metrics.clean-threshold" to a week in conf/application.conf, 
and "metrics.clean-interval" is default 43200.

Nils Kübler

unread,
Mar 31, 2014, 6:09:14 AM3/31/14
to 郭冬冬, hannib...@googlegroups.com
Hi,

unfortunately, it's currently not possible to do that.

If you want to see this feature, please open a Ticket on GitHub! I hope I will find some time to add that as an option.

You could also try to patch it by yourself. Maybe it will work by replacing the following Lines for the  'byNames' method in `app/assets/javascripts/models/Metric.coffe`:

```
  @byNames: (names) ->
    metrics = new Metrics([])
    metrics.url = Routes.Api.metrics
      metric: names
    metrics
```

to this:

```
  @byNames: (names) ->
    metrics = new Metrics([])
    metrics.url = Routes.Api.metrics
      metric: names
      range: new Date().getTime - 1000 * 60 * 60 * 24 * 7 # one Week
    metrics
```

I am not sure wether this actually works. Although, I cannot tell what are the side effects and how big the performance impact is.

Best regards,

Nils



--
You received this message because you are subscribed to the Google Groups "Hannibal developers & users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hannibal-app...@googlegroups.com.
To post to this group, send email to hannib...@googlegroups.com.
Visit this group at http://groups.google.com/group/hannibal-app.
For more options, visit https://groups.google.com/d/optout.



--
Nils Kübler
Software Engineer
____________________________________

YMC AG
Sonnenstr. 4
CH-8280 Kreuzlingen
Switzerland

Tel +41 (0)71 / 508 24 81
Fax +41 (0)71 / 560 53 89

Web www.ymc.ch
____________________________________

郭冬冬

unread,
Mar 31, 2014, 7:00:20 AM3/31/14
to hannib...@googlegroups.com
really appreciate that!
I already made an issiue on github, https://github.com/sentric/hannibal/issues/28

I'm trying to patch as what you said, and will post the result.

在 2014年3月31日星期一UTC+8下午4时29分41秒,郭冬冬写道:

郭冬冬

unread,
Mar 31, 2014, 10:02:19 PM3/31/14
to hannib...@googlegroups.com, 郭冬冬
It did not work, unfortunatelly.
! @6hm1cjf8d - Internal server error, for request [GET /api/metrics?metric=compactions&range=NaN] ->

play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[NumberFormatException: For input string: "NaN"]]
    at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:134) [play_2.9.1-2.0.4.jar:2.0.4]
    at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:115) [play_2.9.1-2.0.4.jar:2.0.4]
    at akka.actor.Actor$class.apply(Actor.scala:318) [akka-actor-2.0.2.jar:2.0.2]
    at play.core.ActionInvoker.apply(Invoker.scala:113) [play_2.9.1-2.0.4.jar:2.0.4]
    at akka.actor.ActorCell.invoke(ActorCell.scala:626) [akka-actor-2.0.2.jar:2.0.2]
    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) [akka-actor-2.0.2.jar:2.0.2]
Caused by: java.lang.NumberFormatException: For input string: "NaN"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:1.6.0_18]
    at java.lang.Long.parseLong(Long.java:438) ~[na:1.6.0_18]
    at java.lang.Long.parseLong(Long.java:478) ~[na:1.6.0_18]
    at scala.collection.immutable.StringLike$class.toLong(StringLike.scala:232) ~[scala-library.jar:na]
    at scala.collection.immutable.StringOps.toLong(StringOps.scala:31) ~[scala-library.jar:na]
    at controllers.Api$$anonfun$metrics$1.apply(Api.scala:45) ~[hannibal_2.9.1-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]

在 2014年3月31日星期一UTC+8下午6时09分14秒,Nils Kübler写道:

Nils Kübler

unread,
Apr 1, 2014, 7:58:22 AM4/1/14
to 郭冬冬, hannib...@googlegroups.com
Hi,

Sorry I made a typo, it's new Date().getTime() - 1000 * 60 * 60 *24

(notice the Braces after getTime())

Cheers

Nils

郭冬冬

unread,
Apr 1, 2014, 8:19:49 AM4/1/14
to hannib...@googlegroups.com, 郭冬冬
Thanks! It worked!
But my chrome is down  :(
Even after I removed metrics.h2.h2.db, I bet the UI js lib causes the problem.

Maybe I should think about other way, how about show 1 week of history in /regions/xxxx ?

在 2014年4月1日星期二UTC+8下午7时58分22秒,Nils Kübler写道:
Reply all
Reply to author
Forward
0 new messages