Skip to content

Commit

Permalink
#22 30 days
Browse files Browse the repository at this point in the history
  • Loading branch information
Yegor Bugayenko committed Nov 20, 2016
1 parent f887c57 commit 26f6bf0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/io/jare/dynamo/DyUsage.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void add(final Date date, final long bytes) throws IOException {
new Directives().xpath(
String.format(
"/usage/day[number(@id) < %d]",
DyUsage.asNumber(DateUtils.addDays(new Date(), -Tv.TEN))
DyUsage.asNumber(DateUtils.addDays(new Date(), -Tv.THIRTY))
)
).remove()
).applyQuietly(node);
Expand Down
6 changes: 3 additions & 3 deletions src/main/xsl/index.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@
<xsl:text> This is the list of </xsl:text>
<xsl:value-of select="$max"/>
<xsl:text> most active of them.</xsl:text>
<xsl:text> The amount of Mb is calculated over the last ten days.</xsl:text>
<xsl:text> The amount of Mb is calculated over the last month.</xsl:text>
<xsl:text> If you see yourself on top of the list, you most probably have to upgrade your account to premium.</xsl:text>
<xsl:text> Please, </xsl:text>
<a href="mailto:premium@jare.io"><xsl:text>email us</xsl:text></a>
<xsl:text> to get an upgrade before we ban you.</xsl:text>
</p>
<xsl:apply-templates select="domains"/>
<p>
<xsl:text>Total traffic over the last ten days: </xsl:text>
<xsl:text>Total traffic over the last month: </xsl:text>
<strong>
<xsl:value-of select="format-number(sum(domains/domain/usage) div (1024 * 1024 * 1024), '###,###,###')"/>
<xsl:text>Gb</xsl:text>
Expand All @@ -102,7 +102,7 @@
<a href="https://aws.amazon.com/cloudfront/pricing/"><xsl:text>approximately</xsl:text></a>
<xsl:text> $</xsl:text>
<xsl:value-of select="format-number(sum(domains/domain/usage) div (1024 * 1024 * 1024) * 0.150 * 3, '###,###.00')"/>
<xsl:text> per month for current traffic.</xsl:text>
<xsl:text> monthly.</xsl:text>
</p>
<p>
<xsl:text>It's an open source system.</xsl:text>
Expand Down

0 comments on commit 26f6bf0

Please sign in to comment.