[Bps-public-commit] app-aws-cloudwatch-monitor branch master updated. f414683aefb1229565ac5582e5337353bec6fdc3
BPS Git Server
git at git.bestpractical.com
Wed May 18 14:20:38 UTC 2022
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "app-aws-cloudwatch-monitor".
The branch, master has been updated
via f414683aefb1229565ac5582e5337353bec6fdc3 (commit)
via 72ab5d30c1ae2827402a620afa068d43d3d2ab2b (commit)
via 980bd9e6116f6b09a58aab09e2415dadb6cfe92b (commit)
via 439a561c699a215cf300a1e79c0c13af7939f131 (commit)
via b48e85cd5d4977f46e39db7cbb0d583070c8d7fa (commit)
via b6980ff550163d5d4431490b6d53efd85c349a9e (commit)
via c0365c2721545a86de66012c02a93111811ddc54 (commit)
via f55b512847a4d7fe2fda99f2f3e0fda2e8d82db8 (commit)
from d5cbd8ba74ccb59c28e178c4524251bd72c34910 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f414683aefb1229565ac5582e5337353bec6fdc3
Merge: f55b512 72ab5d3
Author: Blaine Motsinger <blaine at bestpractical.com>
Date: Wed May 18 09:19:30 2022 -0500
Merge branch 'version-0.02'
commit 72ab5d30c1ae2827402a620afa068d43d3d2ab2b
Author: Blaine Motsinger <blaine at bestpractical.com>
Date: Tue May 17 18:54:07 2022 -0500
Prepare version 0.02
diff --git a/Changes b/Changes
index 52f3b41..db563a3 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,15 @@
Revision history for perl module App::AWS::CloudWatch::Monitor
+0.02 2022-05-17
+ - Add LWP::Protocol::https to deps list
+ - Optimize datetime
+ - Replace DateTime with Time::Piece in deps
+ - Add install instructions
+ - Move config.ini.example into examples dir
+
+ [Revisions to CloudWatchClient.pm]
+ - Replace DateTime with Time::Piece
+
0.01 2022-03-08
- Initial version
diff --git a/bin/aws-cloudwatch-monitor b/bin/aws-cloudwatch-monitor
index 40073c7..4dd7d74 100755
--- a/bin/aws-cloudwatch-monitor
+++ b/bin/aws-cloudwatch-monitor
@@ -21,7 +21,7 @@ use Getopt::Long qw(:config pass_through);
use Pod::Usage ();
use App::AWS::CloudWatch::Monitor;
-my $VERSION = '0.01';
+my $VERSION = '0.02';
Getopt::Long::GetOptions(
\my %opt,
diff --git a/lib/App/AWS/CloudWatch/Monitor.pm b/lib/App/AWS/CloudWatch/Monitor.pm
index 11a8f03..7b243e7 100644
--- a/lib/App/AWS/CloudWatch/Monitor.pm
+++ b/lib/App/AWS/CloudWatch/Monitor.pm
@@ -23,7 +23,7 @@ use List::Util;
use Try::Tiny;
use Module::Loader;
-our $VERSION = '0.01';
+our $VERSION = '0.02';
my $config;
diff --git a/lib/App/AWS/CloudWatch/Monitor/AwsSignatureV4.pm b/lib/App/AWS/CloudWatch/Monitor/AwsSignatureV4.pm
index c39bedd..a49c771 100644
--- a/lib/App/AWS/CloudWatch/Monitor/AwsSignatureV4.pm
+++ b/lib/App/AWS/CloudWatch/Monitor/AwsSignatureV4.pm
@@ -41,7 +41,7 @@ use Digest::SHA qw(sha256_hex hmac_sha256 hmac_sha256_hex);
# For using PurePerl implementation of SHA functions
# use Digest::SHA::PurePerl qw(sha256_hex hmac_sha256 hmac_sha256_hex);
-our $VERSION = '0.01';
+our $VERSION = '0.02';
# RFC3986 safe/unsafe characters
our $SAFE_CHARACTERS = 'A-Za-z0-9\-\._~';
diff --git a/lib/App/AWS/CloudWatch/Monitor/Check.pm b/lib/App/AWS/CloudWatch/Monitor/Check.pm
index 24121ee..fb31bb3 100644
--- a/lib/App/AWS/CloudWatch/Monitor/Check.pm
+++ b/lib/App/AWS/CloudWatch/Monitor/Check.pm
@@ -19,7 +19,7 @@ use warnings;
use Capture::Tiny;
-our $VERSION = '0.01';
+our $VERSION = '0.02';
sub new {
my $class = shift;
diff --git a/lib/App/AWS/CloudWatch/Monitor/Check/DiskSpace.pm b/lib/App/AWS/CloudWatch/Monitor/Check/DiskSpace.pm
index 44e9e98..b0d330b 100644
--- a/lib/App/AWS/CloudWatch/Monitor/Check/DiskSpace.pm
+++ b/lib/App/AWS/CloudWatch/Monitor/Check/DiskSpace.pm
@@ -21,7 +21,7 @@ use parent 'App::AWS::CloudWatch::Monitor::Check';
use Getopt::Long qw(:config pass_through);
-our $VERSION = '0.01';
+our $VERSION = '0.02';
sub check {
my $self = shift;
diff --git a/lib/App/AWS/CloudWatch/Monitor/Check/Inode.pm b/lib/App/AWS/CloudWatch/Monitor/Check/Inode.pm
index d39f161..1806490 100644
--- a/lib/App/AWS/CloudWatch/Monitor/Check/Inode.pm
+++ b/lib/App/AWS/CloudWatch/Monitor/Check/Inode.pm
@@ -21,7 +21,7 @@ use parent 'App::AWS::CloudWatch::Monitor::Check';
use Getopt::Long qw(:config pass_through);
-our $VERSION = '0.01';
+our $VERSION = '0.02';
sub check {
my $self = shift;
diff --git a/lib/App/AWS/CloudWatch/Monitor/Check/LoadAvg.pm b/lib/App/AWS/CloudWatch/Monitor/Check/LoadAvg.pm
index 9414c8c..a5bd636 100644
--- a/lib/App/AWS/CloudWatch/Monitor/Check/LoadAvg.pm
+++ b/lib/App/AWS/CloudWatch/Monitor/Check/LoadAvg.pm
@@ -19,7 +19,7 @@ use warnings;
use parent 'App::AWS::CloudWatch::Monitor::Check';
-our $VERSION = '0.01';
+our $VERSION = '0.02';
sub check {
my $self = shift;
diff --git a/lib/App/AWS/CloudWatch/Monitor/Check/Memory.pm b/lib/App/AWS/CloudWatch/Monitor/Check/Memory.pm
index efbca99..82cc7e1 100644
--- a/lib/App/AWS/CloudWatch/Monitor/Check/Memory.pm
+++ b/lib/App/AWS/CloudWatch/Monitor/Check/Memory.pm
@@ -19,7 +19,7 @@ use warnings;
use parent 'App::AWS::CloudWatch::Monitor::Check';
-our $VERSION = '0.01';
+our $VERSION = '0.02';
sub check {
my $self = shift;
diff --git a/lib/App/AWS/CloudWatch/Monitor/Check/Process.pm b/lib/App/AWS/CloudWatch/Monitor/Check/Process.pm
index 8142f81..a487d39 100644
--- a/lib/App/AWS/CloudWatch/Monitor/Check/Process.pm
+++ b/lib/App/AWS/CloudWatch/Monitor/Check/Process.pm
@@ -21,7 +21,7 @@ use parent 'App::AWS::CloudWatch::Monitor::Check';
use Getopt::Long qw(:config pass_through);
-our $VERSION = '0.01';
+our $VERSION = '0.02';
sub check {
my $self = shift;
diff --git a/lib/App/AWS/CloudWatch/Monitor/CloudWatchClient.pm b/lib/App/AWS/CloudWatch/Monitor/CloudWatchClient.pm
index 918bcc5..21c8845 100644
--- a/lib/App/AWS/CloudWatch/Monitor/CloudWatchClient.pm
+++ b/lib/App/AWS/CloudWatch/Monitor/CloudWatchClient.pm
@@ -45,7 +45,7 @@ use LWP 6;
use LWP::Simple qw($ua get);
$ua->timeout(2); # timeout for meta-data calls
-our $VERSION = '0.01';
+our $VERSION = '0.02';
our %version_prefix_map = ( '2010-08-01' => [ 'GraniteServiceVersion20100801', 'com.amazonaws.cloudwatch.v2010_08_01#' ] );
diff --git a/lib/App/AWS/CloudWatch/Monitor/Config.pm b/lib/App/AWS/CloudWatch/Monitor/Config.pm
index 03e9d70..2ffdfe3 100644
--- a/lib/App/AWS/CloudWatch/Monitor/Config.pm
+++ b/lib/App/AWS/CloudWatch/Monitor/Config.pm
@@ -19,7 +19,7 @@ use warnings;
use Config::Tiny;
-our $VERSION = '0.01';
+our $VERSION = '0.02';
sub load {
my $config = _load_and_verify();
diff --git a/t/lib/App/AWS/CloudWatch/Monitor/Check/TestArgs.pm b/t/lib/App/AWS/CloudWatch/Monitor/Check/TestArgs.pm
index 4166809..4a576f4 100644
--- a/t/lib/App/AWS/CloudWatch/Monitor/Check/TestArgs.pm
+++ b/t/lib/App/AWS/CloudWatch/Monitor/Check/TestArgs.pm
@@ -7,7 +7,7 @@ use parent 'App::AWS::CloudWatch::Monitor::Check';
use Getopt::Long qw(:config pass_through);
-our $VERSION = '0.01';
+our $VERSION = '0.02';
sub check {
my $self = shift;
diff --git a/t/lib/App/AWS/CloudWatch/Monitor/Check/TestSuccess.pm b/t/lib/App/AWS/CloudWatch/Monitor/Check/TestSuccess.pm
index 53d741f..ac00c0d 100644
--- a/t/lib/App/AWS/CloudWatch/Monitor/Check/TestSuccess.pm
+++ b/t/lib/App/AWS/CloudWatch/Monitor/Check/TestSuccess.pm
@@ -5,7 +5,7 @@ use warnings;
use parent 'App::AWS::CloudWatch::Monitor::Check';
-our $VERSION = '0.01';
+our $VERSION = '0.02';
sub check {
my $self = shift;
diff --git a/t/lib/App/AWS/CloudWatch/Monitor/Test.pm b/t/lib/App/AWS/CloudWatch/Monitor/Test.pm
index 22d2c1d..2d93c11 100644
--- a/t/lib/App/AWS/CloudWatch/Monitor/Test.pm
+++ b/t/lib/App/AWS/CloudWatch/Monitor/Test.pm
@@ -5,7 +5,7 @@ use warnings;
use parent 'Test::More';
-our $VERSION = '0.01';
+our $VERSION = '0.02';
sub import {
my $class = shift;
commit 980bd9e6116f6b09a58aab09e2415dadb6cfe92b
Author: Blaine Motsinger <blaine at bestpractical.com>
Date: Tue May 17 18:52:16 2022 -0500
Move config.ini.example into examples dir
diff --git a/MANIFEST b/MANIFEST
index 6c34cae..37b3296 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,6 +1,6 @@
bin/aws-cloudwatch-monitor
Changes
-config.ini.example
+examples/config.ini.example
lib/App/AWS/CloudWatch/Monitor.pm
lib/App/AWS/CloudWatch/Monitor/AwsSignatureV4.pm
lib/App/AWS/CloudWatch/Monitor/Check.pm
diff --git a/config.ini.example b/examples/config.ini.example
similarity index 100%
rename from config.ini.example
rename to examples/config.ini.example
commit 439a561c699a215cf300a1e79c0c13af7939f131
Author: Blaine Motsinger <blaine at bestpractical.com>
Date: Tue May 17 18:11:42 2022 -0500
Add install instructions
diff --git a/README b/README
index cfbc7c6..718c282 100644
--- a/README
+++ b/README
@@ -35,6 +35,15 @@ METHODS
For options and arguments to "run", see the documentation for
aws-cloudwatch-monitor.
+INSTALLATION
+ perl Makefile.PL
+ make
+ make test && sudo make install
+
+ "App::AWS::CloudWatch::Monitor" can also be installed using cpanm.
+
+ cpanm App::AWS::CloudWatch::Monitor
+
CONFIGURATION
To send metrics to AWS, you need to provide the access key id and secret
access key for your configured AWS CloudWatch service. You can set these
diff --git a/README.md b/README.md
index 5cea11c..3eb725f 100644
--- a/README.md
+++ b/README.md
@@ -39,6 +39,16 @@ For adding check modules, see the documentation for [App::AWS::CloudWatch::Monit
For options and arguments to `run`, see the documentation for [aws-cloudwatch-monitor](https://metacpan.org/pod/aws-cloudwatch-monitor).
+# INSTALLATION
+
+ perl Makefile.PL
+ make
+ make test && sudo make install
+
+`App::AWS::CloudWatch::Monitor` can also be installed using [cpanm](https://metacpan.org/pod/cpanm).
+
+ cpanm App::AWS::CloudWatch::Monitor
+
# CONFIGURATION
To send metrics to AWS, you need to provide the access key id and secret access key for your configured AWS CloudWatch service. You can set these in the file `config.ini`.
diff --git a/lib/App/AWS/CloudWatch/Monitor.pm b/lib/App/AWS/CloudWatch/Monitor.pm
index e786e0d..11a8f03 100644
--- a/lib/App/AWS/CloudWatch/Monitor.pm
+++ b/lib/App/AWS/CloudWatch/Monitor.pm
@@ -210,6 +210,16 @@ For options and arguments to C<run>, see the documentation for L<aws-cloudwatch-
=back
+=head1 INSTALLATION
+
+ perl Makefile.PL
+ make
+ make test && sudo make install
+
+C<App::AWS::CloudWatch::Monitor> can also be installed using L<cpanm>.
+
+ cpanm App::AWS::CloudWatch::Monitor
+
=head1 CONFIGURATION
To send metrics to AWS, you need to provide the access key id and secret access key for your configured AWS CloudWatch service. You can set these in the file C<config.ini>.
commit b48e85cd5d4977f46e39db7cbb0d583070c8d7fa
Author: Blaine Motsinger <blaine at bestpractical.com>
Date: Fri May 13 16:08:50 2022 -0500
Replace DateTime with Time::Piece in deps
diff --git a/Makefile.PL b/Makefile.PL
index 501179e..abd072b 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -36,7 +36,6 @@ WriteMakefile(
'Config::Tiny' => 0,
'Compress::Zlib' => 0,
'constant' => 0,
- 'DateTime' => 0,
'Digest::SHA' => 0,
'Exporter' => 0,
'File::Basename' => 0,
@@ -50,6 +49,7 @@ WriteMakefile(
'parent' => 0,
'Pod::Usage' => '1.67', # rewrite in 1.62, bugfixes in 1.67
'strict' => 0,
+ 'Time::Piece' => 0,
'Try::Tiny' => 0,
'URI::Escape' => 0,
'warnings' => 0,
commit b6980ff550163d5d4431490b6d53efd85c349a9e
Author: Blaine Motsinger <blaine at bestpractical.com>
Date: Fri May 13 13:37:12 2022 -0500
Optimize datetime
DateTime is expensive to use, both in execution time and memory.
Since aws-cloudwatch-monitor only needs the localtime epoch,
switching DateTime with Time::Piece is much more efficient.
diff --git a/lib/App/AWS/CloudWatch/Monitor.pm b/lib/App/AWS/CloudWatch/Monitor.pm
index 60eb77c..e786e0d 100644
--- a/lib/App/AWS/CloudWatch/Monitor.pm
+++ b/lib/App/AWS/CloudWatch/Monitor.pm
@@ -93,7 +93,7 @@ sub run {
foreach my $metric ( @{$metrics} ) {
push( @{ $metric->{Dimensions} }, { 'Name' => 'InstanceId', 'Value' => $instance_id } );
- $metric->{Timestamp} = App::AWS::CloudWatch::Monitor::CloudWatchClient::get_offset_time(NOW);
+ $metric->{Timestamp} = App::AWS::CloudWatch::Monitor::CloudWatchClient::get_timestamp();
push( @{ $param->{Input}{MetricData} }, $metric );
}
diff --git a/lib/App/AWS/CloudWatch/Monitor/CloudWatchClient.pm b/lib/App/AWS/CloudWatch/Monitor/CloudWatchClient.pm
index 85eb584..918bcc5 100644
--- a/lib/App/AWS/CloudWatch/Monitor/CloudWatchClient.pm
+++ b/lib/App/AWS/CloudWatch/Monitor/CloudWatchClient.pm
@@ -36,7 +36,7 @@ use base 'Exporter';
our @EXPORT = qw();
use File::Basename;
use App::AWS::CloudWatch::Monitor::AwsSignatureV4;
-use DateTime;
+use Time::Piece;
use Digest::SHA qw(hmac_sha256_base64);
use URI::Escape qw(uri_escape_utf8);
use Compress::Zlib;
@@ -554,17 +554,16 @@ sub prepare_credentials {
return { "code" => OK };
}
-=item get_offset_time
+=item get_timestamp
-Retrieves the current UTC time minus the offset (in hours).
+Retrieves the local timestamp.
=cut
-sub get_offset_time {
- my $offset = shift;
- my $dt = DateTime->now();
- $dt->subtract( hours => $offset );
- return $dt->epoch;
+sub get_timestamp {
+ my $t = localtime;
+ my $timestamp = $t->epoch;
+ return $timestamp;
}
=item print_out
commit c0365c2721545a86de66012c02a93111811ddc54
Author: Blaine Motsinger <blaine at bestpractical.com>
Date: Fri May 13 17:04:37 2022 -0500
Add LWP::Protocol::https to deps list
LWP::Protocol::https is required for LWP to connect over https.
Check for it when building the Makefile.
diff --git a/Makefile.PL b/Makefile.PL
index aa61497..501179e 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -44,6 +44,7 @@ WriteMakefile(
'Getopt::Long' => '2.45', # 2.36 is required for options we need, but at least 2.45 for bugfixes
'List::Util' => 0,
'LWP' => 6,
+ 'LWP::Protocol::https' => 0,
'LWP::Simple' => 0,
'Module::Loader' => 0,
'parent' => 0,
commit f55b512847a4d7fe2fda99f2f3e0fda2e8d82db8
Author: Blaine Motsinger <blaine at bestpractical.com>
Date: Tue Mar 8 16:57:31 2022 -0600
Prepare version 0.01
diff --git a/Changes b/Changes
index 7184110..52f3b41 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,6 @@
Revision history for perl module App::AWS::CloudWatch::Monitor
-0.01 YYYY-MM-DD
+0.01 2022-03-08
- Initial version
[Revisions to AwsSignatureV4.pm]
-----------------------------------------------------------------------
Summary of changes:
Changes | 12 +++++++++++-
MANIFEST | 2 +-
Makefile.PL | 3 ++-
README | 9 +++++++++
README.md | 10 ++++++++++
bin/aws-cloudwatch-monitor | 2 +-
config.ini.example => examples/config.ini.example | 0
lib/App/AWS/CloudWatch/Monitor.pm | 14 ++++++++++++--
lib/App/AWS/CloudWatch/Monitor/AwsSignatureV4.pm | 2 +-
lib/App/AWS/CloudWatch/Monitor/Check.pm | 2 +-
lib/App/AWS/CloudWatch/Monitor/Check/DiskSpace.pm | 2 +-
lib/App/AWS/CloudWatch/Monitor/Check/Inode.pm | 2 +-
lib/App/AWS/CloudWatch/Monitor/Check/LoadAvg.pm | 2 +-
lib/App/AWS/CloudWatch/Monitor/Check/Memory.pm | 2 +-
lib/App/AWS/CloudWatch/Monitor/Check/Process.pm | 2 +-
lib/App/AWS/CloudWatch/Monitor/CloudWatchClient.pm | 17 ++++++++---------
lib/App/AWS/CloudWatch/Monitor/Config.pm | 2 +-
t/lib/App/AWS/CloudWatch/Monitor/Check/TestArgs.pm | 2 +-
t/lib/App/AWS/CloudWatch/Monitor/Check/TestSuccess.pm | 2 +-
t/lib/App/AWS/CloudWatch/Monitor/Test.pm | 2 +-
20 files changed, 65 insertions(+), 26 deletions(-)
rename config.ini.example => examples/config.ini.example (100%)
hooks/post-receive
--
app-aws-cloudwatch-monitor
More information about the Bps-public-commit
mailing list