Skip to content

Commit 88be9d3

Browse files
author
Marcin Przepiorowski
committed
version 2.4.21
2 parents ec75b15 + e174435 commit 88be9d3

16 files changed

+335
-89
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,11 @@ jobs:
319319
brew install [email protected]
320320
$CELL/bin/cpanm Crypt::[email protected]
321321
$CELL/bin/cpanm Crypt::Blowfish
322-
export OPENSSL_PREFIX=`brew --prefix [email protected]`
323-
echo $OPENSSL_PREFIX
324-
export LIBS="-d=$OPENSSL_PREFIX"
325-
$CELL/bin/cpanm --configure-args=$LIBS Filter::Crypto::Decrypt
322+
# export OPENSSL_PREFIX=`brew --prefix [email protected]`
323+
# echo $OPENSSL_PREFIX
324+
# export LIBS="-d=$OPENSSL_PREFIX"
325+
# $CELL/bin/cpanm --configure-args=$LIBS Filter::Crypto::Decrypt
326+
$CELL/bin/cpanm Filter::Crypto::Decrypt
326327
$CELL/bin/cpanm JSON
327328
$CELL/bin/cpanm Date::Manip
328329
# force requires after 1/1/2020 ?

.github/workflows/develop.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ jobs:
379379
#brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/8ff2935985d6da4f2f463ea2666545e6017c4d54/Formula/perl.rb
380380
#brew install pioro/repo/[email protected]
381381
#brew install cpanminus
382-
383382
#CELL=`brew --prefix pioro/repo/[email protected]`
384383
CELL=`brew --prefix perl`
385384
#export PATH=$CELL/bin:$PATH
@@ -390,13 +389,17 @@ jobs:
390389
# cpanm --local-lib=~/perl5 local::lib
391390
# eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
392391
# echo $PERL_MB_OPT
393-
brew install [email protected]
392+
#brew uninstall --ignore-dependencies [email protected]
393+
curl https://raw.githubusercontent.com/Homebrew/homebrew-core/ffa0f6655cbbbecaafb5334cefaae4c3eb1ffb8a/Formula/openssl%401.1.rb -o openssl\@1.1.rb
394+
#cat ./openssl\@1.1.rb
395+
#brew install --build-from-source ./openssl\@1.1.rb
394396
$CELL/bin/cpanm Crypt::[email protected]
395397
$CELL/bin/cpanm Crypt::Blowfish
396-
export OPENSSL_PREFIX=`brew --prefix [email protected]`
397-
echo $OPENSSL_PREFIX
398-
export LIBS="-d=$OPENSSL_PREFIX"
399-
$CELL/bin/cpanm --configure-args=$LIBS Filter::Crypto::Decrypt
398+
# export OPENSSL_PREFIX=`brew --prefix [email protected]`
399+
# echo $OPENSSL_PREFIX
400+
# export LIBS="-d=$OPENSSL_PREFIX"
401+
# $CELL/bin/cpanm --configure-args=$LIBS Filter::Crypto::Decrypt
402+
$CELL/bin/cpanm Filter::Crypto::Decrypt
400403
$CELL/bin/cpanm JSON
401404
$CELL/bin/cpanm Date::Manip
402405
# force requires after 1/1/2020 ?
@@ -415,6 +418,12 @@ jobs:
415418
$CELL/bin/cpanm PAR::Packer
416419
$CELL/bin/cpanm List::MoreUtils::PP
417420
421+
422+
- name: Check log
423+
if: failure()
424+
run: |
425+
cat /Users/runner/.cpanm/work/*/build.log
426+
418427
- name: Compile
419428
run: |
420429
#CELL=`brew --prefix pioro/repo/[email protected]`

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## 2.4.21
2+
3+
### Added
4+
- support for object level stats in the dx_get_capacity_history
5+
6+
### Changes:
7+
- compability with new engines (up to 16)
8+
- fixes in the timestamp support (-st) and (-et)
9+
110
## 2.4.20
211

312
### Added

bin/dx_ctl_jobs.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@
116116
}
117117

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

bin/dx_get_audit.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@
117117
my $et_timestamp;
118118

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

bin/dx_get_capacity_history.pl

Lines changed: 137 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,27 @@
3535
use Engine;
3636
use Capacity_obj;
3737
use Formater;
38+
use Databases;
39+
use Group_obj;
3840
use Toolkit_helpers;
3941

4042
my $version = $Toolkit_helpers::version;
4143

4244
my $resolution = 'd';
4345
my $output_unit = 'G';
46+
my $scope = 'system';
47+
4448

4549
GetOptions(
4650
'help|?' => \(my $help),
4751
'd|engine=s' => \(my $dx_host),
52+
'scope=s' => \($scope),
4853
'format=s' => \(my $format),
54+
'name=s' => \(my $dbname),
55+
'type=s' => \(my $type),
56+
'group=s' => \(my $group),
57+
'dsource=s' => \(my $dsource),
58+
'host=s' => \(my $host),
4959
'st=s' => \(my $st),
5060
'et=s' => \(my $et),
5161
'debug:i' => \(my $debug),
@@ -84,39 +94,78 @@
8494
exit (1);
8595
}
8696

97+
98+
if (!((lc $scope eq 'system') || (lc $scope eq 'object'))) {
99+
print "Option scope can have only value system or object \n";
100+
pod2usage(-verbose => 1, -input=>\*DATA);
101+
exit (1);
102+
}
103+
104+
105+
Toolkit_helpers::check_filer_options (undef,$type, $group, $host, $dbname);
106+
87107
# this array will have all engines to go through (if -d is specified it will be only one engine)
88108
my $engine_list = Toolkit_helpers::get_engine_list($all, $dx_host, $engine_obj);
89109

90110
my $output = new Formater();
91111

92112

93-
if (defined($details)) {
94-
$output->addHeader(
95-
{'Engine', 30},
96-
{'Timestamp', 30},
97-
{Toolkit_helpers::get_unit('dS total',$output_unit) , 15},
98-
{Toolkit_helpers::get_unit('dS current',$output_unit) ,15},
99-
{Toolkit_helpers::get_unit('dS log',$output_unit) ,15},
100-
{Toolkit_helpers::get_unit('dS snaps',$output_unit) ,15},
101-
{Toolkit_helpers::get_unit('VDB total',$output_unit) ,15},
102-
{Toolkit_helpers::get_unit('VDB current',$output_unit) ,15},
103-
{Toolkit_helpers::get_unit('VDB log',$output_unit) ,15},
104-
{Toolkit_helpers::get_unit('VDB snaps',$output_unit) ,15},
105-
{Toolkit_helpers::get_unit('Total',$output_unit) , 15},
106-
{'Usage [%]', 12}
107-
);
113+
if (lc $scope eq 'system') {
114+
if (defined($details)) {
115+
$output->addHeader(
116+
{'Engine', 30},
117+
{'Timestamp', 30},
118+
{Toolkit_helpers::get_unit('dS total',$output_unit) , 15},
119+
{Toolkit_helpers::get_unit('dS current',$output_unit) ,15},
120+
{Toolkit_helpers::get_unit('dS log',$output_unit) ,15},
121+
{Toolkit_helpers::get_unit('dS snaps',$output_unit) ,15},
122+
{Toolkit_helpers::get_unit('VDB total',$output_unit) ,15},
123+
{Toolkit_helpers::get_unit('VDB current',$output_unit) ,15},
124+
{Toolkit_helpers::get_unit('VDB log',$output_unit) ,15},
125+
{Toolkit_helpers::get_unit('VDB snaps',$output_unit) ,15},
126+
{Toolkit_helpers::get_unit('Total',$output_unit) , 15},
127+
{'Usage [%]', 12}
128+
);
129+
} else {
130+
$output->addHeader(
131+
{'Engine', 30},
132+
{'Timestamp', 30},
133+
{Toolkit_helpers::get_unit('dSource',$output_unit), 12},
134+
{Toolkit_helpers::get_unit('Virtual',$output_unit), 12},
135+
{Toolkit_helpers::get_unit('Total',$output_unit), 12},
136+
{'Usage [%]' , 12}
137+
);
138+
}
108139
} else {
109-
$output->addHeader(
110-
{'Engine', 30},
111-
{'Timestamp', 30},
112-
{Toolkit_helpers::get_unit('dSource',$output_unit), 12},
113-
{Toolkit_helpers::get_unit('Virtual',$output_unit), 12},
114-
{Toolkit_helpers::get_unit('Total',$output_unit), 12},
115-
{'Usage [%]' , 12}
116-
);
140+
if (defined($details)) {
141+
$output->addHeader(
142+
{'Engine', 30},
143+
{'Timestamp', 30},
144+
{'Group', 30},
145+
{'Name', 30},
146+
{Toolkit_helpers::get_unit('total',$output_unit), 12},
147+
{Toolkit_helpers::get_unit('current',$output_unit), 12},
148+
{Toolkit_helpers::get_unit('logS',$output_unit), 12},
149+
{Toolkit_helpers::get_unit('snaps',$output_unit), 12},
150+
{Toolkit_helpers::get_unit('locked snaps',$output_unit), 12},
151+
{Toolkit_helpers::get_unit('held snaps',$output_unit), 12},
152+
{Toolkit_helpers::get_unit('policy',$output_unit), 12},
153+
{Toolkit_helpers::get_unit('manual',$output_unit), 12}
154+
);
155+
} else {
156+
$output->addHeader(
157+
{'Engine', 30},
158+
{'Timestamp', 30},
159+
{'Group', 30},
160+
{'Name', 30},
161+
{Toolkit_helpers::get_unit('total',$output_unit), 12},
162+
{Toolkit_helpers::get_unit('current',$output_unit), 12},
163+
{Toolkit_helpers::get_unit('logS',$output_unit), 12},
164+
{Toolkit_helpers::get_unit('snaps',$output_unit), 12}
165+
);
166+
}
117167
}
118168

119-
120169
my $ret = 0;
121170

122171
my %reshash = (
@@ -151,11 +200,31 @@
151200

152201

153202
# load objects for current engine
203+
my $databases = new Databases( $engine_obj, $debug);
204+
my $groups = new Group_obj($engine_obj, $debug);
205+
206+
# filter implementation
207+
208+
my $db_list = Toolkit_helpers::get_dblist_from_filter($type, $group, $host, $dbname, $databases, $groups, undef, $dsource, undef, undef, undef, undef, undef, $debug);
209+
if (! defined($db_list)) {
210+
print "There is no DB selected to process on $engine . Please check filter definitions. \n";
211+
$ret = 1;
212+
next;
213+
}
214+
154215
my $capacity = new Capacity_obj($engine_obj, $debug);
155-
#$capacity->LoadDatabases();
156-
$capacity->LoadSystemHistory($st_timestamp, $et_timestamp, $reshash{$resolution});
157-
$capacity->processSystemHistory($output,$details, $output_unit);
158216

217+
if (lc $scope eq 'system') {
218+
# load objects for current engine
219+
$capacity->LoadSystemHistory($st_timestamp, $et_timestamp, $reshash{$resolution});
220+
$capacity->processSystemHistory($output,$details, $output_unit);
221+
} else {
222+
for my $db_ref (@{$db_list}) {
223+
my $db_obj = $databases->getDB($db_ref);
224+
$capacity->LoadObjectHistory($db_ref, $st_timestamp, $et_timestamp, $reshash{$resolution});
225+
$capacity->processObjectHistory($output,$details, $output_unit);
226+
}
227+
}
159228

160229
}
161230

@@ -177,6 +246,12 @@ =head1 SYNOPSIS
177246
[-et "YYYY-MM-DD [HH24:MI:SS]" ]
178247
[-resolution d|h ]
179248
[-output_unit K|M|G|T]
249+
[-scope system | object ]
250+
[-name database_name ]
251+
[-type vdb | dsource ]
252+
[-group group_name ]
253+
[-dsource dsource_name ]
254+
[-host host_name ]
180255
[-format csv|json ]
181256
[-help|? ]
182257
[-debug ]
@@ -223,6 +298,25 @@ =head1 OPTIONS
223298
Display usage using different unit. By default GB are used
224299
Use K for KiloBytes, G for GigaBytes and M for MegaBytes, T for TeraBytes
225300
301+
=item B<-scope system | object >
302+
Switch to display system capacity history or object capacity history.
303+
Default value is system
304+
305+
=item B<-name database_name >
306+
If scope is set to object, display capacity history of the database_name
307+
308+
=item B<-type vdb | dsource >
309+
If scope is set to object, display capacity history of the objects with db type VDB or dSource
310+
311+
=item B<-group group_name >
312+
If scope is set to object, display capacity history of the objects from group_name
313+
314+
=item B<-dsource dsource_name >
315+
If scope is set to object, display capacity history of the objects with dSource dsource_name
316+
317+
=item B<-host host_name >
318+
If scope is set to object, display capacity history of the objects located on the host host_name
319+
226320
=item B<-format>
227321
Display output in csv or json format
228322
If not specified pretty formatting is used.
@@ -269,4 +363,20 @@ =head1 EXAMPLES
269363
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
270364
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
271365
366+
Display a history of Delphix Engine utilization of the database oratest
367+
368+
dx_get_capacity_history -d dxtest -scope object -name oratest -output_unit M
369+
370+
Engine Timestamp Group Name total [MB] current [MB] logS [MB] snaps [MB]
371+
------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------ ------------ ------------ ------------
372+
dxtest 2023-10-31 02:43:46 PDT Analytics oratest 589.91 166.58 147.63 250.62
373+
dxtest 2023-11-01 02:33:46 PDT Analytics oratest 761.77 164.85 233.53 338.27
374+
dxtest 2023-11-02 02:33:46 PDT Analytics oratest 922.44 166.20 306.78 424.38
375+
dxtest 2023-11-03 02:33:46 PDT Analytics oratest 1045.52 166.66 351.34 502.41
376+
dxtest 2023-11-06 02:21:50 PST Analytics oratest 907.87 166.67 213.66 502.42
377+
dxtest 2023-11-06 03:11:50 PST Analytics oratest 907.87 166.67 213.66 502.42
378+
379+
380+
381+
272382
=cut

bin/dx_get_event.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@
109109
my $et_timestamp;
110110

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

bin/dx_get_faults.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@
131131
my $et_timestamp;
132132

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

bin/dx_get_jobs.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@
177177
my $et_timestamp;
178178

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

bin/dx_get_vdbthroughput.pl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@
108108
exit (1);
109109
}
110110

111-
112-
113111
my $et_timestamp;
114112

115113
if (defined($et)) {
@@ -157,9 +155,13 @@
157155
);
158156

159157

158+
my $detz = $engine_obj->getTimezone();
159+
my $ts_with_tz;
160+
160161
for my $ts (sort (keys(%{$perfdata}))) {
161162
my @tarray = map { $perfdata->{$ts}->{$_} } sort(keys(%{$perfdata->{$ts}}));
162-
my @fullarray = ($ts, @tarray);
163+
$ts_with_tz = Toolkit_helpers::convert_from_utc($ts, $detz, 1);
164+
my @fullarray = ($ts_with_tz, @tarray);
163165
$output->addLine(@fullarray);
164166
}
165167

bin/dx_resolve_faults.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@
142142
my $et_timestamp;
143143

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

0 commit comments

Comments
 (0)