[Predator] Change the way of matching components. |
||
Issue description
Previously, we order the components and return the first matched component.
This way is problematic because we order them by the longest directory path. So
it is possible that:
{
"component": "Blink>JavaScript",
"dirs": [
"src/v8",
"src/v8/src/base/blabla..."
]
},
is ranked higher than:
{
"component": "Blink>JavaScript>GC",
"dirs": [
"src/v8/src/heap"
]
},
If we have file_path like 'src/v8/src/heap/a.cc', it will be matched to "Blink>JavaScript" instead of "Blink>JavaScript>GC".
So, I changed the behavior to let the file_path match all components, and return the component with longest (most '/') matched directory path.
For the example above, both the "Blink>JavaScript" and "Blink>JavaScript>GC" are matched component, but the matched directory for "Blink>JavaScript>GC" - 'src/v8/src/heap' has more '/', so we should return "Blink>JavaScript>GC".
,
Sep 19 2017
The following revision refers to this bug: https://chromium.googlesource.com/infra/infra/+/29ee13e123a9d03e5b005b869b02178cb084d955 commit 29ee13e123a9d03e5b005b869b02178cb084d955 Author: Sharu Jiang <katesonia@google.com> Date: Tue Sep 19 20:49:03 2017 [Predator] Change the way of matching component. Previously, we order the components and return the first matched component. This way is problematic because we order them by the longest directory path. So it is possible that: { "component": "Blink>JavaScript", "dirs": [ "src/v8", "src/v8/src/base/blabla..." ] }, is ranked higher than: { "component": "Blink>JavaScript>GC", "dirs": [ "src/v8/src/heap" ] }, If we have file_path like 'src/v8/src/heap/a.cc', it will be matched to "Blink>JavaScript" instead of "Blink>JavaScript>GC". So, I changed the behavior to let the file_path match all components, and return the component with longest (most '/') matched directory path. For the example above, both the "Blink>JavaScript" and "Blink>JavaScript>GC" are matched component, but the matched directory for "Blink>JavaScript>GC" - 'src/v8/src/heap' has more '/', so we should return "Blink>JavaScript>GC". Bug: 766392 Change-Id: I3467c3cca7dd3738e6733b03039451ecd015ccf8 Reviewed-on: https://chromium-review.googlesource.com/672004 Commit-Queue: Sharu Jiang <katesonia@chromium.org> Reviewed-by: Shuotao Gao <stgao@chromium.org> [modify] https://crrev.com/29ee13e123a9d03e5b005b869b02178cb084d955/appengine/predator/app/backend/handlers/update_component_config.py [modify] https://crrev.com/29ee13e123a9d03e5b005b869b02178cb084d955/appengine/predator/analysis/test/component_classifier_test.py [modify] https://crrev.com/29ee13e123a9d03e5b005b869b02178cb084d955/appengine/predator/analysis/component.py [modify] https://crrev.com/29ee13e123a9d03e5b005b869b02178cb084d955/appengine/predator/analysis/component_classifier.py [modify] https://crrev.com/29ee13e123a9d03e5b005b869b02178cb084d955/appengine/predator/analysis/test/component_test.py [modify] https://crrev.com/29ee13e123a9d03e5b005b869b02178cb084d955/appengine/predator/app/backend/handlers/test/update_component_config_test.py
,
Sep 19 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by kateso...@chromium.org
, Sep 18 2017