Skip to content

Commit

Permalink
Merge pull request akira#33 from akira/akira/split_failed
Browse files Browse the repository at this point in the history
Separate out dead jobs from failed counter
  • Loading branch information
akira authored Dec 25, 2016
2 parents d948455 + 74c0f04 commit c4cee8b
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion priv/ember/app/components/exq-stat.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ExqStat = Ember.Component.extend
link: "index"
classNames: ['col-xs-2']
classNames: ['col-xs-1']

`export default ExqStat`
1 change: 1 addition & 0 deletions priv/ember/app/models/stat.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ Stat = DS.Model.extend
enqueued: DS.attr 'number'
retrying: DS.attr 'number'
scheduled: DS.attr 'number'
dead: DS.attr 'number'
date: DS.attr 'date'
`export default Stat`
2 changes: 1 addition & 1 deletion priv/ember/app/templates/components/exq-navbar.emblem
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ nav.navbar.navbar-default role="navigation"
li
link-to 'scheduled.index' | Scheduled
li
link-to 'failures.index' | Failures
link-to 'failures.index' | Dead
3 changes: 2 additions & 1 deletion priv/ember/app/templates/components/exq-stats.emblem
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
exq-stat title="Processed" stat=stats.processed
exq-stat title="Failed" stat=stats.failed link="failures.index"
exq-stat title="Failed" stat=stats.failed
exq-stat title="Busy" stat=stats.busy link="processes.index"
exq-stat title="Enqueued" stat=stats.enqueued link="queues.index"
exq-stat title="Retries" stat=stats.retrying link="retries.index"
exq-stat title="Scheduled" stat=stats.scheduled link="scheduled.index"
exq-stat title="Dead" stat=stats.dead link="failures.index"
2 changes: 1 addition & 1 deletion priv/ember/app/templates/failures/index.emblem
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ table.table.table-bordered.table-hover
tr
td colspan="6"
button class="btn btn-danger btn-xs" click="clearFailures"
| Clear Failed Jobs List
| Clear Dead Jobs List
2 changes: 1 addition & 1 deletion priv/ember/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</script>

<base href="/" />
<meta name="exq-admin/config/environment" content="%7B%22modulePrefix%22%3A%22exq-admin%22%2C%22environment%22%3A%22development%22%2C%22baseURL%22%3A%22/%22%2C%22locationType%22%3A%22auto%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%7D%2C%22APP%22%3A%7B%22LOG_ACTIVE_GENERATION%22%3Atrue%2C%22LOG_VIEW_LOOKUPS%22%3Atrue%2C%22name%22%3A%22exq-admin%22%2C%22version%22%3A%220.0.0+e3b83078%22%7D%2C%22contentSecurityPolicyHeader%22%3A%22Content-Security-Policy-Report-Only%22%2C%22contentSecurityPolicy%22%3A%7B%22default-src%22%3A%22%27none%27%22%2C%22script-src%22%3A%22%27self%27%20%27unsafe-eval%27%22%2C%22font-src%22%3A%22%27self%27%22%2C%22connect-src%22%3A%22%27self%27%22%2C%22img-src%22%3A%22%27self%27%22%2C%22style-src%22%3A%22%27self%27%22%2C%22media-src%22%3A%22%27self%27%22%7D%2C%22exportApplicationGlobal%22%3Atrue%7D" />
<meta name="exq-admin/config/environment" content="%7B%22modulePrefix%22%3A%22exq-admin%22%2C%22environment%22%3A%22development%22%2C%22baseURL%22%3A%22/%22%2C%22locationType%22%3A%22auto%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%7D%2C%22APP%22%3A%7B%22LOG_ACTIVE_GENERATION%22%3Atrue%2C%22LOG_VIEW_LOOKUPS%22%3Atrue%2C%22name%22%3A%22exq-admin%22%2C%22version%22%3A%22v0.8.2%22%7D%2C%22contentSecurityPolicyHeader%22%3A%22Content-Security-Policy-Report-Only%22%2C%22contentSecurityPolicy%22%3A%7B%22default-src%22%3A%22%27none%27%22%2C%22script-src%22%3A%22%27self%27%20%27unsafe-eval%27%22%2C%22font-src%22%3A%22%27self%27%22%2C%22connect-src%22%3A%22%27self%27%22%2C%22img-src%22%3A%22%27self%27%22%2C%22style-src%22%3A%22%27self%27%22%2C%22media-src%22%3A%22%27self%27%22%7D%2C%22exportApplicationGlobal%22%3Atrue%7D" />

<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/exq-admin.css">
Expand Down
8 changes: 5 additions & 3 deletions web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ defmodule ExqUi.RouterPlug do
{:ok, processed} = Exq.Api.stats(conn.assigns[:exq_name], "processed")
{:ok, failed} = Exq.Api.stats(conn.assigns[:exq_name], "failed")
{:ok, busy} = Exq.Api.busy(conn.assigns[:exq_name])
{:ok, scheduled} = Exq.Api.queue_size(conn.assigns[:exq_name], :scheduled)
{:ok, retrying} = Exq.Api.queue_size(conn.assigns[:exq_name], :retry)
{:ok, scheduled} = Exq.Api.scheduled_size(conn.assigns[:exq_name])
{:ok, retrying} = Exq.Api.retry_size(conn.assigns[:exq_name])
{:ok, dead} = Exq.Api.failed_size(conn.assigns[:exq_name])

{:ok, queues} = Exq.Api.queue_size(conn.assigns[:exq_name])

Expand All @@ -55,7 +56,8 @@ defmodule ExqUi.RouterPlug do
end
qtotal = "#{Enum.sum(queue_sizes)}"

{:ok, json} = Poison.encode(%{stat: %{id: "all", processed: processed || 0, failed: failed || 0, busy: busy || 0, scheduled: scheduled || 0, retrying: retrying || 0, enqueued: qtotal}})
{:ok, json} = Poison.encode(%{stat: %{id: "all", processed: processed || 0, failed: failed || 0,
busy: busy || 0, scheduled: scheduled || 0, dead: dead || 0, retrying: retrying || 0, enqueued: qtotal}})
conn |> send_resp(200, json) |> halt
end

Expand Down

0 comments on commit c4cee8b

Please sign in to comment.