Skip to content

Commit 75074e0

Browse files
committed
Merge branch 'remote-awr-pierce' into 'oramain'
Add awr_replication_cmd for automatic replication of results to remote host. See merge request rwp/rwloadsim!27
2 parents d798845 + 856c69d commit 75074e0

File tree

6 files changed

+45
-0
lines changed

6 files changed

+45
-0
lines changed

bin/mtitplot

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
# Changes:
77
#
8+
# lpierce 17-oct-2024 added awr_replication_cmd execution
89
# bengsig 8-may-2024 global osstat
910
# bengsig 2-may-2024 --fractiles-dropped option to oltpplot
1011
# bengsig 28-apr-2024 osstat
@@ -437,3 +438,6 @@ $osstatembed
437438
<embed src="${runnumber}_instdist.svg"><br>
438439
END
439440

441+
if [ -n "$awr_replication_cmd" ]; then
442+
eval $awr_replication_cmd
443+
fi

bin/oltpplot

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
# Changes:
77
#
8+
# lpierce 17-oct-2024 - added awr_replication_cmd execution
89
# bengsig 23-jul-2024 - ping->connping
910
# bengsig 22-jul-2024 - Show min/max pool when xc changes
1011
# bengsig 22-jul-2024 - Add cstorm logoff time
@@ -1174,3 +1175,6 @@ then
11741175
echo '<embed src="'$ashimg'"><br>' >> $awrdirectory$subdir$runnumber/index.html
11751176
fi
11761177

1178+
if [ -n "$awr_replication_cmd" ]; then
1179+
eval $awr_replication_cmd
1180+
fi

man/man2rwl/oltpsetup.2rwl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,31 @@ If the procedure is not declared, the following will be used
662662
.P
663663
implying rwloadsim will be started locally.
664664
This is always used for process number 1, as it must run locally.
665+
.SH "REMOTE REPORT REPLICATION"
666+
.P
667+
When \fBrwloadsim\fR is running on a machine that cannot host a webservice, it may be useful to replicate the report data to a remote machine. This can be achieved by setting the \fBawr_replication_cmd\fR parameter to a custom command that replicates the data after the report is generated. By default, \fBawr_replication_cmd\fR is not set, so no replication occurs.
668+
.P
669+
If \fBawr_replication_cmd\fR is defined, it will be executed each time a report is generated, allowing automated replication to the specified remote machine. The command typically uses \fBrsync\fR to securely copy the report data. Below is an example of how to configure \fBawr_replication_cmd\fR with \fBrsync\fR:
670+
.P
671+
.nf
672+
rsync -avz -e "ssh -i /path/to/identity" \\
673+
--rsync-path="mkdir -p /path/to/replicate${subdir}${runnumber} \\
674+
&& rsync" $awrdirectory${subdir}${runnumber} \\
675+
user@host:/path/to/replicate${subdir}${runnumber}
676+
.fi
677+
.P
678+
In this example:
679+
.IP
680+
- \fB-avz\fR options enable archive mode (preserving file permissions, timestamps, etc.), verbose output, and compression during transfer.
681+
.IP
682+
- \fB-e\fR specifies the SSH command, here with a custom identity file (\fI/path/to/identity\fR).
683+
.IP
684+
- \fB--rsync-path\fR is used to ensure that the remote directory structure exists by creating the necessary directories with \fBmkdir -p\fR before starting the transfer.
685+
.IP
686+
- The path variables \fI$subdir\fR and \fI$runnumber\fR dynamically set the subdirectory and run number for replication, creating an organized directory structure on the remote machine.
687+
.P
688+
This approach ensures that the report data is replicated to the specified path on the remote host, facilitating centralized data access even when \fBrwloadsim\fR is executed on a machine without webservice capabilities.
689+
665690
.SH "SAVING PASSWORDS IN KEYRING"
666691
If you have gnome keyring available, you can use that to save passwords rather than having them
667692
in your $RWLOLTP_NAME.rwl file.

oltp/oltp.rwl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
awrdirectory := "/NOTSET/var/www/html/key";
1919
resultsdir:="/NOTSET/home/results/key";
2020

21+
# Specify a command for awr results replication.
22+
# The awr_replication_cmd is evaluated in bash as a single quoted string, meaning no variables will be injected directly.
23+
24+
# awr_replication_cmd := "rsync -avz -e \"ssh -i /path/to/identity\" --rsync-path=\"mkdir -p /path/to/replicate${subdir}${runnumber} && rsync\" ${awrdirectory}${subdir}${runnumber} user@host:/path/to/replicate${subdir}${runnumber}";
25+
2126
# The rwloltp suite uses several different connect
2227
# strings for different purposes. In many casess
2328
# they can have the same value.

oltp/parameters.rwl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Licensed under the Universal Permissive License v 1.0
33
# as shown at https://oss.oracle.com/licenses/upl/
44

5+
# lpierce 17-oct-2024 - added awr_replication_cmd
56
# bengsig 10-oct-2023 - sessionpool max use/lifetime
67
# bengsig 31-jul-2023 - rategradientstep
78
# bengsig 17-jun-2023 - add mtit_partitions parameter
@@ -284,6 +285,7 @@ double pool_size_interval := 300;
284285
# These are the ones that MUST be set by the user:
285286

286287
string awrdirectory := "/nowhere";
288+
string(1000) awr_replication_cmd := "";
287289
string resultsdir := "/nowhere";
288290
string subdir := "/r"||runnumber/1000||"/";
289291
string system_connect := "//machine/database";

oltp/parameters2shell.rwl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Licensed under the Universal Permissive License v 1.0
33
# as shown at https://oss.oracle.com/licenses/upl/
44

5+
# lpierce 17-oct-2024 - added export of awr_replication_cmd
56
# bengsig 19-mar-2024 - cstorm
67
# bengsig 24-apr-2023 - mtit
78
# bengsig 25-oct-2022 - External control
@@ -102,6 +103,10 @@ if only_directories or !only_plus then
102103
printline "rwloadsimdir='"||rwloadsimdir||"'";
103104
end if;
104105

106+
if !only_directories and !only_plus then
107+
printline "awr_replication_cmd='"||awr_replication_cmd||"'";
108+
end if;
109+
105110
if only_plus or !only_directories then
106111
if passwords then
107112
printline "#AWR: sqlplus " sysawr_username "/" sysawr_password "@" sysawr_connect;

0 commit comments

Comments
 (0)