ΠšΡƒΠ΄Π° дСлось мСсто Π½Π° сСрвСрС Confluence? Или статистика Confluence ΠΏΠΎ влоТСниям

Π£ вас Π±Ρ‹Π²Π°Π»ΠΎ Ρ‚Π°ΠΊΠΎΠ΅ Π½Π° сСрвСрС Confluence Π·Π°ΠΊΠΎΠ½Ρ‡ΠΈΠ»ΠΎΡΡŒ мСсто, Π° Π²Ρ‹ Π½Π΅ Π·Π½Π°Π΅Ρ‚Π΅ ΠΊΡ‚ΠΎ большС всСго Π·Π°Π³Ρ€ΡƒΠΆΠ°Π΅Ρ‚ Π²Π»ΠΎΠΆΠ΅Π½ΠΈΠΉ?

Π§Ρ‚ΠΎΠ±Ρ‹ ΡƒΠ·Π½Π°Ρ‚ΡŒ это Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌ доступ ΠΊ Π² Π‘Π” PostgreSQL confluence.

Π‘ ΠΏΠΎΠΌΠΎΡ‰ΡŒΡŽ SQL запросом ΠΊ Π‘Π” PostgreSQL ΠΌΠΎΠΆΠ½ΠΎ ΡƒΠ·Π½Π°Ρ‚ΡŒ ΠΏΠΎΠ»Π΅Π·Π½ΡƒΡŽ статистику ΠΏΠΎ Confluence.

ΠžΠ±Ρ‰ΠΈΠΉ Ρ€Π°Π·ΠΌΠ΅Ρ€ всСх Π²Π»ΠΎΠΆΠ΅Π½ΠΈΠΉ Π² Confluence:

SELECT s.spaceid,
       s.spacename,
       sum(LONGVAL)
FROM contentproperties c
JOIN content co ON c.contentid = co.contentid
JOIN spaces s ON co.spaceid = s.spaceid
WHERE c.contentid IN
    (SELECT contentid
     FROM content
     WHERE contenttype = 'ATTACHMENT')
  AND c.propertyname = 'FILESIZE'
GROUP BY s.spaceid
ORDER BY SUM DESC
LIMIT 5;

Π’Ρ‹Π²ΠΎΠ΄ (spacename Π·Π°ΠΌΠ΅Π½ΠΈΠ»):

ΠšΡƒΠ΄Π° дСлось мСсто Π½Π° сСрвСрС Confluence? Или статистика Confluence ΠΏΠΎ влоТСниям

CΡ‚Ρ€Π°Π½ΠΈΡ†Ρ‹ с Π±ΠΎΠ»ΡŒΡˆΠΈΠ½ΡΡ‚Π²ΠΎΠΌ историчСских вСрсий Π² стСчСнии:

SELECT title,
       MAX(VERSION)
FROM content
WHERE contenttype = 'PAGE'
GROUP BY title
ORDER BY 2 DESC
LIMIT 5;

Π’Ρ‹Π²ΠΎΠ΄:

ΠšΡƒΠ΄Π° дСлось мСсто Π½Π° сСрвСрС Confluence? Или статистика Confluence ΠΏΠΎ влоТСниям

CΠ°ΠΌΡ‹Π΅ большиС Ρ„Π°ΠΉΠ»Ρ‹ Π²Π»ΠΎΠΆΠ΅Π½ΠΈΠΉ Π² вашСм экзСмплярС Confluence

SELECT DISTINCT c.contentid,
                c.title AS attachmentTitle,
                u.username AS uploadedBy,
                co.title AS pageTitle,
                cn.longval AS bytes
FROM CONTENT AS c
JOIN USER_MAPPING AS u ON u.user_key = c.creator
JOIN CONTENT AS co ON c.pageid = co.contentid
JOIN CONTENTPROPERTIES AS cn ON cn.contentid = c.contentid
WHERE c.contenttype = 'ATTACHMENT'
  AND cn.longval IS NOT NULL
ORDER BY cn.longval DESC
LIMIT 5;

Π’Ρ‹Π²ΠΎΠ΄:

ΠšΡƒΠ΄Π° дСлось мСсто Π½Π° сСрвСрС Confluence? Или статистика Confluence ΠΏΠΎ влоТСниям

ΠšΠΎΠ»ΠΈΡ‡Π΅ΡΡ‚Π²ΠΎ страниц Π² ΠΊΠΎΡ€Π·ΠΈΠ½Π΅ ΠΈ ΠΎΠ±Ρ‰ΠΈΠΉ Ρ€Π°Π·ΠΌΠ΅Ρ€ страниц Π² ΠΊΠΎΡ€Π·ΠΈΠ½Π΅ Π½Π° пространство:


SELECT Count(content.contentid) AS number_of_trashed_pages,
       Pg_size_pretty(SUM(Pg_column_size(bodycontent.BODY))) AS trash_total_size,
       spaces.spacename AS space_name
FROM bodycontent
INNER JOIN content ON (content.contentid = bodycontent.contentid)
INNER JOIN spaces ON (content.spaceid = spaces.spaceid)
WHERE bodycontent.contentid IN
    (SELECT contentid
     FROM content
     WHERE content_status = 'deleted'
       AND contenttype = 'PAGE')
GROUP BY space_name
ORDER BY trash_total_size
LIMIT 5;

Π’Ρ‹Π²ΠΎΠ΄:

ΠšΡƒΠ΄Π° дСлось мСсто Π½Π° сСрвСрС Confluence? Или статистика Confluence ΠΏΠΎ влоТСниям

ΠžΠ±Ρ‰ΠΈΠΉ Ρ€Π°Π·ΠΌΠ΅Ρ€ Π²Π»ΠΎΠΆΠ΅Π½ΠΈΠΉ, Π·Π°Π³Ρ€ΡƒΠΆΠ΅Π½Π½Ρ‹Ρ… ΠΊΠ°ΠΆΠ΄Ρ‹ΠΌ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Π΅ΠΌ Π½Π° всСх страницах

SELECT u.lower_username,
       sum(cp.longval) AS "size"
FROM content c1
JOIN content c2 ON c1.contentid = c2.pageid
JOIN user_mapping u ON c1.creator=u.user_key
JOIN contentproperties cp ON c2.contentid = cp.contentid
WHERE c2.contenttype='ATTACHMENT'
GROUP BY u.lower_username
ORDER BY sum(cp.longval) DESC
LIMIT 5;

Π’Ρ‹Π²ΠΎΠ΄:

ΠšΡƒΠ΄Π° дСлось мСсто Π½Π° сСрвСрС Confluence? Или статистика Confluence ΠΏΠΎ влоТСниям

P.S. ДополняйтС пост ΠΏΠΎΠ»Π΅Π·Π½Ρ‹ΠΌΠΈ SQL запросами для Confluence

Π˜ΡΡ‚ΠΎΡ‡Π½ΠΈΠΊ: habr.com