Skip to content

Commit

Permalink
changing contract location column for requester peer location in cont…
Browse files Browse the repository at this point in the history
…ract details
  • Loading branch information
alexisbatyk committed Oct 11, 2024
1 parent a9a72d6 commit 19c268e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
8 changes: 4 additions & 4 deletions crates/core/src/tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ impl<'a> NetEventLog<'a> {
id,
..
}) => {
let this_peer = &op_manager.ring.connection_manager.get_peer_key().unwrap();
let this_peer = &op_manager.ring.connection_manager.own_location();
let key = contract.key();
EventKind::Put(PutEvent::Request {
requester: this_peer.clone(),
Expand Down Expand Up @@ -267,7 +267,7 @@ impl<'a> NetEventLog<'a> {
..
}) => EventKind::Put(PutEvent::BroadcastReceived {
id: *id,
requester: sender.peer.clone(),
requester: sender.clone(),
key: *key,
value: new_value.clone(),
target: target.clone(),
Expand Down Expand Up @@ -978,7 +978,7 @@ enum ConnectEvent {
enum PutEvent {
Request {
id: Transaction,
requester: PeerId,
requester: PeerKeyLocation,
key: ContractKey,
target: PeerKeyLocation,
timestamp: u64,
Expand Down Expand Up @@ -1006,7 +1006,7 @@ enum PutEvent {
BroadcastReceived {
id: Transaction,
/// peer who started the broadcast op
requester: PeerId,
requester: PeerKeyLocation,
/// key of the contract which value was being updated
key: ContractKey,
/// value that was put
Expand Down
7 changes: 4 additions & 3 deletions network-monitor/src/contract-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ const ContractPeersHistory = ({
)}
</th>
<th>
Contract Location
Requester <br />
Peer Location
</th>
<th>
Transaction Id
Expand Down Expand Up @@ -220,7 +221,7 @@ const ContractPeersHistory = ({
{tx.contract_id.slice(-8)}
</td>
<td>
{tx.contract_location}
{tx.requester_location}
</td>
<td
onClick={() =>
Expand Down Expand Up @@ -379,7 +380,7 @@ export const ContractDetail = ({
<h2>Contract Details</h2>
<div id="transaction-detail-contents">
<p>Contract Key {transaction.contract_id}</p>
<p>Contract Location {transaction.contract_location}</p>
<p><b>Contract Location</b> {transaction.contract_location}</p>
<p>Requester {transaction.requester}</p>
<p>Target {transaction.target}</p>
{/*<p>Status {transaction.status}</p>
Expand Down
17 changes: 16 additions & 1 deletion network-monitor/src/transactions-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,19 @@ export function handlePutRequest(
timestamp: number,
contract_location: number
) {
let requester_location = parseFloat(
requester.split(" (@ ")[1].split(")")[0]
);

requester = requester.split(" (@")[0];

let obj_data = {
change_type,
transaction_id,
contract_id,
target,
requester,
requester_location,
unique_id:
transaction_id + contract_id + target + requester + change_type,
timestamp,
Expand Down Expand Up @@ -104,7 +111,7 @@ export function handleBroadcastEmitted(
timestamp: number,
contract_location: number
) {
let sender_location = sender.split(" (@")[1].split(")")[0];
let sender_location = parseFloat(sender.split(" (@")[1].split(")")[0]);
sender = sender.split(" (@")[0];

let upstream_location = upstream.split(" (@")[1].split(")")[0];
Expand All @@ -116,6 +123,7 @@ export function handleBroadcastEmitted(
contract_id: key,
target: broadcast_to,
requester: sender,
requester_location: sender_location,
unique_id: transaction_id + key + broadcast_to[0] + sender,
timestamp,
contract_location,
Expand Down Expand Up @@ -148,12 +156,19 @@ export function handleBroadcastReceived(
timestamp: number,
contract_location: number
) {
let requester_location = parseFloat(
requester.split(" (@")[1].split(")")[0]
);

requester = requester.split(" (@")[0];

let obj_data = {
change_type,
transaction_id,
contract_id: key,
target,
requester,
requester_location,
unique_id: transaction_id + key + target + requester,
timestamp,
contract_location,
Expand Down

0 comments on commit 19c268e

Please sign in to comment.