Skip to content

Commit

Permalink
refactor(framework:skip) Reorder and remove unused events (#4105)
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljanes authored Aug 29, 2024
1 parent b817b3b commit ea2f4ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 29 deletions.
26 changes: 5 additions & 21 deletions src/py/flwr/common/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,34 +162,18 @@ def _generate_next_value_(name: str, start: int, count: int, last_values: List[A

# --- Deployment Engine ------------------------------------------------------------

# Driver API
RUN_DRIVER_API_ENTER = auto()
RUN_DRIVER_API_LEAVE = auto()

# Fleet API
RUN_FLEET_API_ENTER = auto()
RUN_FLEET_API_LEAVE = auto()

# Driver API and Fleet API
# CLI: `flower-superlink`
RUN_SUPERLINK_ENTER = auto()
RUN_SUPERLINK_LEAVE = auto()

# Driver: Driver
DRIVER_CONNECT = auto()
DRIVER_DISCONNECT = auto()

# Driver: start_driver
START_DRIVER_ENTER = auto()
START_DRIVER_LEAVE = auto()
# CLI: `flower-supernode`
RUN_SUPERNODE_ENTER = auto()
RUN_SUPERNODE_LEAVE = auto()

# flower-server-app
# CLI: `flower-server-app`
RUN_SERVER_APP_ENTER = auto()
RUN_SERVER_APP_LEAVE = auto()

# SuperNode
RUN_SUPERNODE_ENTER = auto()
RUN_SUPERNODE_LEAVE = auto()

# --- DEPRECATED -------------------------------------------------------------------

# [DEPRECATED] CLI: `flower-client-app`
Expand Down
5 changes: 0 additions & 5 deletions src/py/flwr/server/compat/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from logging import INFO
from typing import Optional

from flwr.common import EventType, event
from flwr.common.logger import log
from flwr.server.client_manager import ClientManager
from flwr.server.history import History
Expand Down Expand Up @@ -65,8 +64,6 @@ def start_driver( # pylint: disable=too-many-arguments, too-many-locals
hist : flwr.server.history.History
Object containing training and evaluation metrics.
"""
event(EventType.START_DRIVER_ENTER)

# Initialize the Driver API server and config
initialized_server, initialized_config = init_defaults(
server=server,
Expand Down Expand Up @@ -96,6 +93,4 @@ def start_driver( # pylint: disable=too-many-arguments, too-many-locals
f_stop.set()
thread.join()

event(EventType.START_SERVER_LEAVE)

return hist
4 changes: 1 addition & 3 deletions src/py/flwr/server/driver/grpc_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import grpc

from flwr.common import DEFAULT_TTL, EventType, Message, Metadata, RecordSet, event
from flwr.common import DEFAULT_TTL, Message, Metadata, RecordSet
from flwr.common.grpc import create_channel
from flwr.common.logger import log
from flwr.common.serde import (
Expand Down Expand Up @@ -94,7 +94,6 @@ def _connect(self) -> None:
This will not call GetRun.
"""
event(EventType.DRIVER_CONNECT)
if self._is_connected:
log(WARNING, "Already connected")
return
Expand All @@ -108,7 +107,6 @@ def _connect(self) -> None:

def _disconnect(self) -> None:
"""Disconnect from the Driver API."""
event(EventType.DRIVER_DISCONNECT)
if not self._is_connected:
log(DEBUG, "Already disconnected")
return
Expand Down

0 comments on commit ea2f4ce

Please sign in to comment.