Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change from Network Latency to Step Processing Latency. Closes #239 #240

Merged
merged 4 commits into from
Aug 28, 2023

Conversation

edavalosanaya
Copy link
Collaborator

fix(latency of step): Changed the logic of the profiler to instead focus on the out-going data chunk's and their latency.

…cus on the out-going data chunk's and their latency.
@edavalosanaya edavalosanaya self-assigned this Aug 24, 2023
@edavalosanaya
Copy link
Collaborator Author

Here is an overview of the changes:

Instead of computing latency and payload in the pre-step of a Node, we compute these metrics after the completion of step function. Instead of computing latency in terms of transmitted - received, the Node performs a tic-toc approach by wrapping the step function.

async def post_step(self, data_chunk: DataChunk):
        # assert self.process
        if not self.process:
            return None

        # Computing the diagnostics metrics per step
        payload_size = 0.0

        # Containers to compute metrics
        payload_sizes: List[float] = []

        # Obtain the meta data of the data chunk
        meta = data_chunk.get("meta")["value"]

        # Get the payload size (of all keys)
        total_size = 0.0
        for key in data_chunk.contains():
            payload = data_chunk.get(key)["value"]
            total_size += self.get_object_kilobytes(payload)
        payload_sizes.append(total_size)

        # After processing all data_chunk keys, get payload total
        payload_size = sum(payload_sizes)

        # Store results
        self.deques["latency(ms)"].append(meta['delta'])
        self.deques["payload_size(KB)"].append(payload_size)

The deltais the step processing time, stored in the added field in the data chunk:

class DataChunk:
    def __init__(self):
        # Removed code to show the change

        # Adding default key-value pair
        self._container["meta"] = {
            "value": {
                "ownership": [],
                "created": datetime.datetime.now(),
                "delta": 0, # ms <---- THIS IS THE NEW FIELD
                "transmitted": None,
                "received": None,
            },
            "content-type": "meta",
        }

With these changes, the profiling makes more sense, as now all the metrics (resources, payload, latency) are 100% about the current Node running the ProfilingService.

@edavalosanaya edavalosanaya merged commit 0ab869c into main Aug 28, 2023
3 checks passed
@edavalosanaya edavalosanaya deleted the 239-latency-step branch September 8, 2023 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant