ticket_backlog.rb 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. class Report::TicketBacklog < Report::Base
  2. =begin
  3. result = Report::TicketBacklog.aggs(
  4. range_start: '2015-01-01T00:00:00Z',
  5. range_end: '2015-12-31T23:59:59Z',
  6. interval: 'month', # quarter, month, week, day, hour, minute, second
  7. selector: selector, # ticket selector to get only a collection of tickets
  8. )
  9. returns
  10. [4,5,1,5,0,51,5,56,7,4]
  11. =end
  12. def self.aggs(params)
  13. local_params = params.clone
  14. local_params[:params] = {}
  15. local_params[:params][:field] = 'created_at'
  16. created = Report::TicketGenericTime.aggs(local_params)
  17. local_params[:params][:field] = 'close_at'
  18. closed = Report::TicketGenericTime.aggs(local_params)
  19. result = []
  20. (0..created.length - 1).each { |position|
  21. count = created[position] - closed[position]
  22. result.push count
  23. }
  24. result
  25. end
  26. =begin
  27. result = Report::TicketBacklog.items(
  28. range_start: '2015-01-01T00:00:00Z',
  29. range_end: '2015-12-31T23:59:59Z',
  30. selector: selector, # ticket selector to get only a collection of tickets
  31. )
  32. returns
  33. {}
  34. =end
  35. def self.items(_params)
  36. {}
  37. end
  38. end