Skip to content

Commit

Permalink
Add node id to farmer and harvester stats
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbrucker committed Sep 23, 2023
1 parent cb48604 commit 30dcc6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/service/db/satellite.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const satelliteSchema = new mongoose.Schema({
}],
default: undefined,
},
nodeId: String,
},
lastUpdate: Date,
},
Expand All @@ -60,6 +61,7 @@ const satelliteSchema = new mongoose.Schema({
totalRawPlotCapacityInGib: String,
totalEffectivePlotCapacityInGib: String,
farmerConnectionsCount: Number,
nodeId: String,
},
lastUpdate: Date,
},
Expand Down
6 changes: 6 additions & 0 deletions lib/service/update-query-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class UpdateQueryFactory {
if (stats.farmingInfos !== undefined) {
updateQuery['services.farmer.stats.farmingInfos'] = stats.farmingInfos
}
if (stats.nodeId !== undefined) {
updateQuery['services.farmer.stats.nodeId'] = stats.nodeId
}

return updateQuery
}
Expand Down Expand Up @@ -118,6 +121,9 @@ class UpdateQueryFactory {
if (stats.farmerConnectionsCount !== undefined) {
updateQuery['services.harvester.stats.farmerConnectionsCount'] = stats.farmerConnectionsCount
}
if (stats.nodeId !== undefined) {
updateQuery['services.harvester.stats.nodeId'] = stats.nodeId
}

return updateQuery
}
Expand Down

0 comments on commit 30dcc6e

Please sign in to comment.