Closed Bug 723601 Opened 12 years ago Closed 12 years ago

[Telemetry dashboard] Histogram selector should match inside the histogram name

Categories

(Mozilla Metrics :: Frontend Reports, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Moved to JIRA

People

(Reporter: justin.lebar+bug, Unassigned)

Details

(Whiteboard: [JIRA BIV-109] [Telemetry:P1])

I could have sworn I'd filed a bug on this, but I can't find it.  So here's a new one.

Right now, the histogram selector only matches from the beginning of the histogram name.  But I should be able to type "JPEG" into the histogram selector and see all histograms which contain "JPEG".

What I'd like is something which roughly follows the following idiom.  Here, |search| is what the user typed into the search box, and |hist| is the histogram name.  This function returns true if |hist| matches |search|.

def match(search, hist):
  search_split = set(search.toLowerCase().split()) # split on spaces
  hist_split = set(special_split(hist.toLowerCase()))

  # Return true if every element in search_split is in hist_split
  return search_split.isSubset(hist_split)

def special_split(str):
  # Split |str| on "_", but return every possible joining of tokens.  For example, 
  # special_split("foo_bar_baz") returns ["foo", "bar", "baz", "bee", "foo_bar", 
  #                                       "bar_baz", "foo_bar_baz"].
  #
  # Implementation left as an exercise to the reader.  :)
Should be

  # special_split("foo_bar_baz") returns ["foo", "bar", "baz", "foo_bar", 
  #                                       "bar_baz", "foo_bar_baz"].
Can you write that in perl please?  ;)
Ah!  For perl, I imagine I could get close with

  $ cat /dev/urandom | head -n10
Whiteboard: [Telemetry]
Marking: in group of > 33 asks for Telemetry that need PM priority before triage/scheduling.
Status: NEW → ASSIGNED
Whiteboard: [Telemetry] → Telemetry -- needs PM project priority
Triaged.
Target Milestone: Unreviewed → Backlogged - BZ
Whiteboard: Telemetry -- needs PM project priority → [Telemetry:P1]
Whiteboard: [Telemetry:P1] → [JIRA BIV-109] [Telemetry:P1]
Target Milestone: Backlogged - BZ → Moved to JIRA
when searching for a measure it will not look only from the beginning of the string, but all string, for example, if you type "collector" it will show all measures that have "collector"
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
(In reply to Paulo Pires from comment #6)
> when searching for a measure it will not look only from the beginning of the
> string, but all string, for example, if you type "collector" it will show
> all measures that have "collector"

I don't see this behavior for Histogram and Evolution views, only in the Slow SQL view. Am I misunderstadning?
As Justin mentioned on IRC, if you don't see this functionality you should clear your cache.
The fix was accidentally regressed last week.  We re-opened the JIRA and are re-deploying the fix today.
This has been re-fixed.
You need to log in before you can comment on or make changes to this bug.