Skip to content

Commit

Permalink
version 2.4.21
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Przepiorowski committed Nov 15, 2023
2 parents ec75b15 + e174435 commit 88be9d3
Show file tree
Hide file tree
Showing 16 changed files with 335 additions and 89 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,11 @@ jobs:
brew install [email protected]
$CELL/bin/cpanm Crypt::[email protected]
$CELL/bin/cpanm Crypt::Blowfish
export OPENSSL_PREFIX=`brew --prefix [email protected]`
echo $OPENSSL_PREFIX
export LIBS="-d=$OPENSSL_PREFIX"
$CELL/bin/cpanm --configure-args=$LIBS Filter::Crypto::Decrypt
# export OPENSSL_PREFIX=`brew --prefix [email protected]`
# echo $OPENSSL_PREFIX
# export LIBS="-d=$OPENSSL_PREFIX"
# $CELL/bin/cpanm --configure-args=$LIBS Filter::Crypto::Decrypt
$CELL/bin/cpanm Filter::Crypto::Decrypt
$CELL/bin/cpanm JSON
$CELL/bin/cpanm Date::Manip
# force requires after 1/1/2020 ?
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ jobs:
#brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/8ff2935985d6da4f2f463ea2666545e6017c4d54/Formula/perl.rb
#brew install pioro/repo/[email protected]
#brew install cpanminus
#CELL=`brew --prefix pioro/repo/[email protected]`
CELL=`brew --prefix perl`
#export PATH=$CELL/bin:$PATH
Expand All @@ -390,13 +389,17 @@ jobs:
# cpanm --local-lib=~/perl5 local::lib
# eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
# echo $PERL_MB_OPT
brew install [email protected]
#brew uninstall --ignore-dependencies [email protected]
curl https://raw.githubusercontent.com/Homebrew/homebrew-core/ffa0f6655cbbbecaafb5334cefaae4c3eb1ffb8a/Formula/openssl%401.1.rb -o openssl\@1.1.rb
#cat ./openssl\@1.1.rb
#brew install --build-from-source ./openssl\@1.1.rb
$CELL/bin/cpanm Crypt::[email protected]
$CELL/bin/cpanm Crypt::Blowfish
export OPENSSL_PREFIX=`brew --prefix [email protected]`
echo $OPENSSL_PREFIX
export LIBS="-d=$OPENSSL_PREFIX"
$CELL/bin/cpanm --configure-args=$LIBS Filter::Crypto::Decrypt
# export OPENSSL_PREFIX=`brew --prefix [email protected]`
# echo $OPENSSL_PREFIX
# export LIBS="-d=$OPENSSL_PREFIX"
# $CELL/bin/cpanm --configure-args=$LIBS Filter::Crypto::Decrypt
$CELL/bin/cpanm Filter::Crypto::Decrypt
$CELL/bin/cpanm JSON
$CELL/bin/cpanm Date::Manip
# force requires after 1/1/2020 ?
Expand All @@ -415,6 +418,12 @@ jobs:
$CELL/bin/cpanm PAR::Packer
$CELL/bin/cpanm List::MoreUtils::PP
- name: Check log
if: failure()
run: |
cat /Users/runner/.cpanm/work/*/build.log
- name: Compile
run: |
#CELL=`brew --prefix pioro/repo/[email protected]`
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 2.4.21

### Added
- support for object level stats in the dx_get_capacity_history

### Changes:
- compability with new engines (up to 16)
- fixes in the timestamp support (-st) and (-et)

## 2.4.20

### Added
Expand Down
1 change: 0 additions & 1 deletion bin/dx_ctl_jobs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
}

if (defined($et)) {
$et = Toolkit_helpers::timestamp_to_timestamp_with_de_timezone($et, $engine_obj);
if (! defined($et_timestamp = Toolkit_helpers::timestamp($et, $engine_obj))) {
print "Wrong end time (et) format \n";
pod2usage(-verbose => 1, -input=>\*DATA);
Expand Down
1 change: 0 additions & 1 deletion bin/dx_get_audit.pl
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@
my $et_timestamp;

if (defined($et)) {
$et = Toolkit_helpers::timestamp_to_timestamp_with_de_timezone($et, $engine_obj);
if (! defined($et_timestamp = Toolkit_helpers::timestamp($et, $engine_obj))) {
print "Wrong end time (et) format \n";
pod2usage(-verbose => 1, -input=>\*DATA);
Expand Down
164 changes: 137 additions & 27 deletions bin/dx_get_capacity_history.pl
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,27 @@
use Engine;
use Capacity_obj;
use Formater;
use Databases;
use Group_obj;
use Toolkit_helpers;

my $version = $Toolkit_helpers::version;

my $resolution = 'd';
my $output_unit = 'G';
my $scope = 'system';


GetOptions(
'help|?' => \(my $help),
'd|engine=s' => \(my $dx_host),
'scope=s' => \($scope),
'format=s' => \(my $format),
'name=s' => \(my $dbname),
'type=s' => \(my $type),
'group=s' => \(my $group),
'dsource=s' => \(my $dsource),
'host=s' => \(my $host),
'st=s' => \(my $st),
'et=s' => \(my $et),
'debug:i' => \(my $debug),
Expand Down Expand Up @@ -84,39 +94,78 @@
exit (1);
}


if (!((lc $scope eq 'system') || (lc $scope eq 'object'))) {
print "Option scope can have only value system or object \n";
pod2usage(-verbose => 1, -input=>\*DATA);
exit (1);
}


Toolkit_helpers::check_filer_options (undef,$type, $group, $host, $dbname);

# this array will have all engines to go through (if -d is specified it will be only one engine)
my $engine_list = Toolkit_helpers::get_engine_list($all, $dx_host, $engine_obj);

my $output = new Formater();


if (defined($details)) {
$output->addHeader(
{'Engine', 30},
{'Timestamp', 30},
{Toolkit_helpers::get_unit('dS total',$output_unit) , 15},
{Toolkit_helpers::get_unit('dS current',$output_unit) ,15},
{Toolkit_helpers::get_unit('dS log',$output_unit) ,15},
{Toolkit_helpers::get_unit('dS snaps',$output_unit) ,15},
{Toolkit_helpers::get_unit('VDB total',$output_unit) ,15},
{Toolkit_helpers::get_unit('VDB current',$output_unit) ,15},
{Toolkit_helpers::get_unit('VDB log',$output_unit) ,15},
{Toolkit_helpers::get_unit('VDB snaps',$output_unit) ,15},
{Toolkit_helpers::get_unit('Total',$output_unit) , 15},
{'Usage [%]', 12}
);
if (lc $scope eq 'system') {
if (defined($details)) {
$output->addHeader(
{'Engine', 30},
{'Timestamp', 30},
{Toolkit_helpers::get_unit('dS total',$output_unit) , 15},
{Toolkit_helpers::get_unit('dS current',$output_unit) ,15},
{Toolkit_helpers::get_unit('dS log',$output_unit) ,15},
{Toolkit_helpers::get_unit('dS snaps',$output_unit) ,15},
{Toolkit_helpers::get_unit('VDB total',$output_unit) ,15},
{Toolkit_helpers::get_unit('VDB current',$output_unit) ,15},
{Toolkit_helpers::get_unit('VDB log',$output_unit) ,15},
{Toolkit_helpers::get_unit('VDB snaps',$output_unit) ,15},
{Toolkit_helpers::get_unit('Total',$output_unit) , 15},
{'Usage [%]', 12}
);
} else {
$output->addHeader(
{'Engine', 30},
{'Timestamp', 30},
{Toolkit_helpers::get_unit('dSource',$output_unit), 12},
{Toolkit_helpers::get_unit('Virtual',$output_unit), 12},
{Toolkit_helpers::get_unit('Total',$output_unit), 12},
{'Usage [%]' , 12}
);
}
} else {
$output->addHeader(
{'Engine', 30},
{'Timestamp', 30},
{Toolkit_helpers::get_unit('dSource',$output_unit), 12},
{Toolkit_helpers::get_unit('Virtual',$output_unit), 12},
{Toolkit_helpers::get_unit('Total',$output_unit), 12},
{'Usage [%]' , 12}
);
if (defined($details)) {
$output->addHeader(
{'Engine', 30},
{'Timestamp', 30},
{'Group', 30},
{'Name', 30},
{Toolkit_helpers::get_unit('total',$output_unit), 12},
{Toolkit_helpers::get_unit('current',$output_unit), 12},
{Toolkit_helpers::get_unit('logS',$output_unit), 12},
{Toolkit_helpers::get_unit('snaps',$output_unit), 12},
{Toolkit_helpers::get_unit('locked snaps',$output_unit), 12},
{Toolkit_helpers::get_unit('held snaps',$output_unit), 12},
{Toolkit_helpers::get_unit('policy',$output_unit), 12},
{Toolkit_helpers::get_unit('manual',$output_unit), 12}
);
} else {
$output->addHeader(
{'Engine', 30},
{'Timestamp', 30},
{'Group', 30},
{'Name', 30},
{Toolkit_helpers::get_unit('total',$output_unit), 12},
{Toolkit_helpers::get_unit('current',$output_unit), 12},
{Toolkit_helpers::get_unit('logS',$output_unit), 12},
{Toolkit_helpers::get_unit('snaps',$output_unit), 12}
);
}
}


my $ret = 0;

my %reshash = (
Expand Down Expand Up @@ -151,11 +200,31 @@


# load objects for current engine
my $databases = new Databases( $engine_obj, $debug);
my $groups = new Group_obj($engine_obj, $debug);

# filter implementation

my $db_list = Toolkit_helpers::get_dblist_from_filter($type, $group, $host, $dbname, $databases, $groups, undef, $dsource, undef, undef, undef, undef, undef, $debug);
if (! defined($db_list)) {
print "There is no DB selected to process on $engine . Please check filter definitions. \n";
$ret = 1;
next;
}

my $capacity = new Capacity_obj($engine_obj, $debug);
#$capacity->LoadDatabases();
$capacity->LoadSystemHistory($st_timestamp, $et_timestamp, $reshash{$resolution});
$capacity->processSystemHistory($output,$details, $output_unit);

if (lc $scope eq 'system') {
# load objects for current engine
$capacity->LoadSystemHistory($st_timestamp, $et_timestamp, $reshash{$resolution});
$capacity->processSystemHistory($output,$details, $output_unit);
} else {
for my $db_ref (@{$db_list}) {
my $db_obj = $databases->getDB($db_ref);
$capacity->LoadObjectHistory($db_ref, $st_timestamp, $et_timestamp, $reshash{$resolution});
$capacity->processObjectHistory($output,$details, $output_unit);
}
}

}

Expand All @@ -177,6 +246,12 @@ =head1 SYNOPSIS
[-et "YYYY-MM-DD [HH24:MI:SS]" ]
[-resolution d|h ]
[-output_unit K|M|G|T]
[-scope system | object ]
[-name database_name ]
[-type vdb | dsource ]
[-group group_name ]
[-dsource dsource_name ]
[-host host_name ]
[-format csv|json ]
[-help|? ]
[-debug ]
Expand Down Expand Up @@ -223,6 +298,25 @@ =head1 OPTIONS
Display usage using different unit. By default GB are used
Use K for KiloBytes, G for GigaBytes and M for MegaBytes, T for TeraBytes
=item B<-scope system | object >
Switch to display system capacity history or object capacity history.
Default value is system
=item B<-name database_name >
If scope is set to object, display capacity history of the database_name
=item B<-type vdb | dsource >
If scope is set to object, display capacity history of the objects with db type VDB or dSource
=item B<-group group_name >
If scope is set to object, display capacity history of the objects from group_name
=item B<-dsource dsource_name >
If scope is set to object, display capacity history of the objects with dSource dsource_name
=item B<-host host_name >
If scope is set to object, display capacity history of the objects located on the host host_name
=item B<-format>
Display output in csv or json format
If not specified pretty formatting is used.
Expand Down Expand Up @@ -269,4 +363,20 @@ =head1 EXAMPLES
Landshark51 2017-03-09 09:52:50 GMT 1.22 1.21 0.00 0.00 0.03 0.03 0.00 0.00 1.25 4.34
Landshark51 2017-03-09 13:22:50 GMT 1.23 1.21 0.00 0.01 0.05 0.03 0.01 0.00 1.28 4.46
Display a history of Delphix Engine utilization of the database oratest
dx_get_capacity_history -d dxtest -scope object -name oratest -output_unit M
Engine Timestamp Group Name total [MB] current [MB] logS [MB] snaps [MB]
------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------ ------------ ------------ ------------
dxtest 2023-10-31 02:43:46 PDT Analytics oratest 589.91 166.58 147.63 250.62
dxtest 2023-11-01 02:33:46 PDT Analytics oratest 761.77 164.85 233.53 338.27
dxtest 2023-11-02 02:33:46 PDT Analytics oratest 922.44 166.20 306.78 424.38
dxtest 2023-11-03 02:33:46 PDT Analytics oratest 1045.52 166.66 351.34 502.41
dxtest 2023-11-06 02:21:50 PST Analytics oratest 907.87 166.67 213.66 502.42
dxtest 2023-11-06 03:11:50 PST Analytics oratest 907.87 166.67 213.66 502.42
=cut
1 change: 0 additions & 1 deletion bin/dx_get_event.pl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
my $et_timestamp;

if (defined($et)) {
$et = Toolkit_helpers::timestamp_to_timestamp_with_de_timezone($et, $engine_obj);
if (! defined($et_timestamp = Toolkit_helpers::timestamp($et, $engine_obj))) {
print "Wrong end time (et) format \n";
pod2usage(-verbose => 1, -input=>\*DATA);
Expand Down
1 change: 0 additions & 1 deletion bin/dx_get_faults.pl
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
my $et_timestamp;

if (defined($et)) {
$et = Toolkit_helpers::timestamp_to_timestamp_with_de_timezone($et, $engine_obj);
if (! defined($et_timestamp = Toolkit_helpers::timestamp($et, $engine_obj))) {
print "Wrong end time (et) format \n";
pod2usage(-verbose => 1, -input=>\*DATA);
Expand Down
1 change: 0 additions & 1 deletion bin/dx_get_jobs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@
my $et_timestamp;

if (defined($et)) {
$et = Toolkit_helpers::timestamp_to_timestamp_with_de_timezone($et, $engine_obj);
if (! defined($et_timestamp = Toolkit_helpers::timestamp($et, $engine_obj))) {
print "Wrong end time (et) format \n";
pod2usage(-verbose => 1, -input=>\*DATA);
Expand Down
8 changes: 5 additions & 3 deletions bin/dx_get_vdbthroughput.pl
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@
exit (1);
}



my $et_timestamp;

if (defined($et)) {
Expand Down Expand Up @@ -157,9 +155,13 @@
);


my $detz = $engine_obj->getTimezone();
my $ts_with_tz;

for my $ts (sort (keys(%{$perfdata}))) {
my @tarray = map { $perfdata->{$ts}->{$_} } sort(keys(%{$perfdata->{$ts}}));
my @fullarray = ($ts, @tarray);
$ts_with_tz = Toolkit_helpers::convert_from_utc($ts, $detz, 1);
my @fullarray = ($ts_with_tz, @tarray);
$output->addLine(@fullarray);
}

Expand Down
1 change: 0 additions & 1 deletion bin/dx_resolve_faults.pl
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@
my $et_timestamp;

if (defined($et)) {
$et = Toolkit_helpers::timestamp_to_timestamp_with_de_timezone($et, $engine_obj);
if (! defined($et_timestamp = Toolkit_helpers::timestamp($et, $engine_obj))) {
print "Wrong end time (et) format \n";
pod2usage(-verbose => 1, -input=>\*DATA);
Expand Down
Loading

0 comments on commit 88be9d3

Please sign in to comment.