summaryrefslogtreecommitdiff
path: root/web/views/reports/database_statistics.erb
blob: fe36c974a8b6b695edc01f25e25d5e02613d605c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<h1><%= t.reports.database_statistics.name %></h1>

<div class="stats" style="float: left; padding-right: 60px;">
    <div>
        <h2><img class="icon_large" src="/img/types/all.24.png" alt=""/> Objects</h2>
        <table class="stats">
            <tr><td style="width: 7em;">There are </td><td style="width: 7em;" class="number"><%= @db.stats('objects').to_s_with_ts %></td><td> objects in the database</td></tr>
            <tr><td>with together </td><td class="number"><%= @db.stats('object_tags').to_s_with_ts %></td><td> tags</td></tr>
        </table>
    </div>
    <div>
        <h2><img class="icon_large" src="/img/types/node.24.png" alt=""/> Nodes</h2>
        <table class="stats">
            <tr><td style="width: 7em;">There are </td><td style="width: 7em;" class="number"><%= @db.stats('nodes').to_s_with_ts %></td><td> nodes</td></tr>
            <tr><td>of which </td><td class="number"><%= @db.stats('nodes_with_tags').to_s_with_ts %></td><td> have at least one tag</td></tr>
            <tr><td>(thats </td><td class="number"><%= (10000.0 * @db.stats('nodes_with_tags') / @db.stats('nodes')).to_i.to_f / 100 %></td><td> %)</td></tr>
            <tr><td>with together </td><td class="number"><%= @db.stats('node_tags').to_s_with_ts %></td><td> tags</td></tr>
            <tr><td>(or about </td><td class="number"><%= ( 100.0 * @db.stats('node_tags') / @db.stats('nodes_with_tags')).to_i.to_f / 100 %></td><td> tags per tagged node)</td></tr>
        </table>
    </div>
    <div>
        <h2><img class="icon_large" src="/img/types/way.24.png" alt=""/> Ways</h2>
        <table class="stats">
            <tr><td style="width: 7em;">There are </td><td style="width: 7em;" class="number"><%= @db.stats('ways').to_s_with_ts %></td><td> ways</td></tr>
            <tr><td>(of which </td><td class="number"><%= @db.stats('closed_ways').to_s_with_ts %></td><td> are closed)</td></tr>
            <tr><td>with together </td><td class="number"><%= @db.stats('way_tags').to_s_with_ts %></td><td> tags</td></tr>
            <tr><td>(or about </td><td class="number"><%= ( 100.0 * @db.stats('way_tags') / @db.stats('ways')).to_i.to_f / 100 %></td><td> tags per way)</td></tr>
        </table>
    </div>
    <div>
        <h2><img class="icon_large" src="/img/types/relation.24.png" alt=""/> Relations</h2>
        <table class="stats">
            <tr><td style="width: 7em;">There are </td><td style="width: 7em;" class="number"><%= @db.stats('relations').to_s_with_ts %></td><td> relations</td></tr>
            <tr><td>with together </td><td class="number"><%= @db.stats('relation_tags').to_s_with_ts %></td><td> tags</td></tr>
            <tr><td>(or about </td><td class="number"><%= ( 100.0 * @db.stats('relation_tags') / @db.stats('relations')).to_i.to_f / 100 %></td><td> tags per relation)</td></tr>
        </table>
    </div>
</div>

<div class="stats">
    <div>
        <h2><img class="icon_large" src="/img/types/tag.24.png" alt=""/> Tags</h2>
        <table class="stats">
            <tr><td style="width: 7em;">There are </td><td style="width: 7em;" class="number"><%= @db.stats('num_keys').to_s_with_ts %></td><td> different keys</td></tr>
            <tr><td>and </td><td class="number"><%= @db.stats('num_tags').to_s_with_ts %></td><td> different tags</td></tr>
        </table>
    </div>
</div>