Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions code/go/0chain.net/blobbercore/stats/blobberstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type WriteMarkersStat struct {
}

type Stats struct {
TotalSize int64 `json:"total_size"` // the total allocated size
AllocatedSize int64 `json:"allocated_size"`
UsedSize int64 `json:"used_size"`
FilesSize int64 `json:"files_size"`
ThumbnailsSize int64 `json:"thumbnails_size"`
Expand Down Expand Up @@ -145,7 +145,7 @@ func (bs *BlobberStats) loadDetailedStats(ctx context.Context) {
}

given[as.AllocationID] = struct{}{}
bs.TotalSize += as.TotalSize
bs.AllocatedSize += as.AllocatedSize

as.ReadMarkers, err = loadAllocReadMarkersStat(ctx, as.AllocationID)
if err != nil {
Expand Down Expand Up @@ -252,7 +252,7 @@ func (bs *BlobberStats) loadAllocationStats(ctx context.Context) {
SUM(file_stats.num_of_block_downloads) as num_of_reads,
SUM(reference_objects.num_of_blocks) as num_of_block_writes,
COUNT(*) as num_of_writes,
allocations.size AS total_size,
allocations.size AS allocated_size,
allocations.expiration_date AS expiration_date`).
Joins(`INNER JOIN file_stats
ON reference_objects.id = file_stats.ref_id`).
Expand All @@ -273,8 +273,8 @@ func (bs *BlobberStats) loadAllocationStats(ctx context.Context) {

for rows.Next() {
var as = &AllocationStats{}
err = rows.Scan(&as.AllocationID, &as.TotalSize, &as.FilesSize, &as.ThumbnailsSize,
&as.NumReads, &as.BlockWrites, &as.NumWrites, &as.Expiration)
err = rows.Scan(&as.AllocationID, &as.FilesSize, &as.ThumbnailsSize,
&as.NumReads, &as.BlockWrites, &as.NumWrites, &as.AllocatedSize, &as.Expiration)
if err != nil {
Logger.Error("Error in scanning record for blobber stats",
zap.Error(err))
Expand Down
2 changes: 1 addition & 1 deletion code/go/0chain.net/blobbercore/stats/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const tpl = `<!DOCTYPE html>
</tr>
<tr>
<td>Allocated size (bytes)</td>
<td>{{ .TotalSize }}</td>
<td>{{ .AllocatedSize }}</td>
</tr>
<tr>
<td>Used Size (bytes)</td>
Expand Down