Skip to content

Commit

Permalink
Remove extra logging
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulJKim committed Aug 26, 2024
1 parent 135c50a commit b005b04
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 91 deletions.
72 changes: 0 additions & 72 deletions lib/content/message/predictions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -70,41 +70,6 @@ defmodule Content.Message.Predictions do
# e.g., North Station which is non-terminal but has trips that begin there
predicted_time = prediction.seconds_until_arrival || prediction.seconds_until_departure

if sign.id in [
"malden_center_platform",
"green_street_northbound",
"revere_beach_westbound",
"davis_southbound",
"quincy_adams_northbound",
"shawmut_northbound"
] do
Logger.info([
"prediction_info: ",
"station_code=",
station_code,
" zone=",
zone,
" trip_id=",
prediction.trip_id,
" stop_id=",
prediction.stop_id,
" vehicle_id=",
inspect(prediction.vehicle_id),
" direction_id=",
inspect(prediction.direction_id),
" seconds_until_departure=",
inspect(prediction.seconds_until_departure),
" boarding_status=",
inspect(prediction.boarding_status),
" vehicle_status=",
inspect(prediction.vehicle_status),
" vehicle_location_stop_id=",
inspect(prediction.vehicle_location_stop_id),
" vehicle_location_trip_id=",
inspect(prediction.vehicle_location_trip_id)
])
end

certainty =
if prediction.seconds_until_arrival,
do: prediction.arrival_certainty,
Expand Down Expand Up @@ -210,43 +175,6 @@ defmodule Content.Message.Predictions do
nil
end

if prediction.seconds_until_departure + @terminal_prediction_offset_seconds <=
@terminal_brd_seconds do
Logger.info([
"prediction_info: ",
"station_code=",
station_code,
" zone=",
zone,
" trip_id=",
prediction.trip_id,
" stop_id=",
prediction.stop_id,
" vehicle_id=",
inspect(prediction.vehicle_id),
" direction_id=",
inspect(prediction.direction_id),
" seconds_until_departure=",
inspect(prediction.seconds_until_departure),
" boarding_status=",
inspect(prediction.boarding_status),
" stopped_at_predicted_stop=",
inspect(prediction.stopped_at_predicted_stop?),
" vehicle_status=",
inspect(prediction.vehicle_status),
" vehicle_location_stop_id=",
inspect(prediction.vehicle_location_stop_id),
" vehicle_location_trip_id=",
inspect(prediction.vehicle_location_trip_id),
" computed_minute=",
inspect(minutes),
" prediction_certainty=",
inspect(prediction.departure_certainty),
" terminal_prediction=",
inspect(terminal_prediction)
])
end

terminal_prediction
end

Expand Down
10 changes: 2 additions & 8 deletions lib/predictions/prediction.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ defmodule Predictions.Prediction do
stopped_at_predicted_stop?: false,
boarding_status: nil,
revenue_trip?: true,
vehicle_id: nil,
vehicle_status: nil,
vehicle_location_stop_id: nil,
vehicle_location_trip_id: nil
vehicle_id: nil

@type trip_id :: String.t()

Expand All @@ -35,9 +32,6 @@ defmodule Predictions.Prediction do
stopped_at_predicted_stop?: boolean(),
boarding_status: String.t() | nil,
revenue_trip?: boolean(),
vehicle_id: String.t() | nil,
vehicle_status: :incoming_at | :stopped_at | :in_transit_to,
vehicle_location_stop_id: String.t(),
vehicle_location_trip_id: String.t()
vehicle_id: String.t() | nil
}
end
12 changes: 1 addition & 11 deletions lib/predictions/predictions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,6 @@ defmodule Predictions.Predictions do
else: nil

vehicle_location = Engine.Locations.for_vehicle(vehicle_id)
vehicle_status = if not is_nil(vehicle_location), do: vehicle_location.status, else: "none"

vehicle_locaton_stop_id =
if not is_nil(vehicle_location), do: vehicle_location.stop_id, else: "none"

vehicle_location_trip_id =
if not is_nil(vehicle_location), do: vehicle_location.trip_id, else: "none"

%Prediction{
stop_id: stop_time_update["stop_id"],
Expand All @@ -113,10 +106,7 @@ defmodule Predictions.Predictions do
stop_time_update["stop_id"] == vehicle_location.stop_id,
boarding_status: stop_time_update["boarding_status"],
revenue_trip?: revenue_trip?,
vehicle_id: vehicle_id,
vehicle_status: vehicle_status,
vehicle_location_stop_id: vehicle_locaton_stop_id,
vehicle_location_trip_id: vehicle_location_trip_id
vehicle_id: vehicle_id
}
end

Expand Down

0 comments on commit b005b04

Please sign in to comment.