92c2e41dfdb30756a5872578b38b34cd34722d76,python/ray/state.py,GlobalState,profile_table,#GlobalState#,479

Before Change



    def profile_table(self):
        self._check_connected()
        profile_table_keys = self._keys(gcs_utils.TablePrefix_PROFILE_string +
                                        "*")
        batch_identifiers_binary = [
            key[len(gcs_utils.TablePrefix_PROFILE_string):]
            for key in profile_table_keys
        ]

        result = defaultdict(list)
        for batch_id in batch_identifiers_binary:
            profile_data = self._profile_table(binary_to_object_id(batch_id))
            // Note that if keys are being evicted from Redis, then it is
            // possible that the batch will be evicted before we get it.
            if len(profile_data) > 0:
                component_id = profile_data[0]["component_id"]
                result[component_id].extend(profile_data)

        return dict(result)

After Change



            component_type = profile.component_type
            component_id = binary_to_hex(profile.component_id)
            node_ip_address = profile.node_ip_address

            for event in profile.profile_events:
                try:
                    extra_data = json.loads(event.extra_data)
                except ValueError:
                    extra_data = {}
                profile_event = {
                    "event_type": event.event_type,
                    "component_id": component_id,
                    "node_ip_address": node_ip_address,
                    "component_type": component_type,
                    "start_time": event.start_time,
                    "end_time": event.end_time,
                    "extra_data": extra_data
                }

                result[component_id].append(profile_event)

        return dict(result)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: ray-project/ray
Commit Name: 92c2e41dfdb30756a5872578b38b34cd34722d76
Time: 2020-05-24
Author: dooku.wt@antfin.com
File Name: python/ray/state.py
Class Name: GlobalState
Method Name: profile_table


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: f06010e9e5104bacbc219fde90a769151f7f031a
Time: 2018-03-08
Author: yuyantingzero@gmail.com
File Name: perfkitbenchmarker/providers/aws/aws_managed_relational_db.py
Class Name: AwsManagedRelationalDb
Method Name: _IsInstanceReady


Project Name: EducationalTestingService/skll
Commit Name: cf26ab001151638caa67ad8580f8d7f13e0490ac
Time: 2014-11-13
Author: nmadnani@ets.org
File Name: tests/test_preprocessing.py
Class Name:
Method Name: test_class_map


Project Name: EducationalTestingService/skll
Commit Name: cf26ab001151638caa67ad8580f8d7f13e0490ac
Time: 2014-11-13
Author: nmadnani@ets.org
File Name: tests/test_preprocessing.py
Class Name:
Method Name: test_class_map_feature_hasher