Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
6c1dc74b
Commit
6c1dc74b
authored
4 years ago
by
Brad Payne (Vir Linden)
Browse files
Options
Downloads
Patches
Plain Diff
SL-15031 - include settings_per_account stats
parent
2e255caa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/metrics/viewerstats.py
+22
-6
22 additions, 6 deletions
scripts/metrics/viewerstats.py
with
22 additions
and
6 deletions
scripts/metrics/viewerstats.py
+
22
−
6
View file @
6c1dc74b
...
...
@@ -70,17 +70,28 @@ def show_stats_by_key(recs,indices,settings_sd = None):
if
settings_sd
is
not
None
:
print
"
Total keys in settings
"
,
len
(
settings_sd
.
keys
())
unused_keys
=
list
(
set
(
settings_sd
.
keys
())
-
set
(
cnt
.
keys
()))
print
"
\n
Unused_keys
"
,
len
(
unused_keys
)
unused_keys_non_str
=
[
k
for
k
in
unused_keys
if
settings_sd
[
k
][
"
Type
"
]
!=
"
String
"
]
unused_keys_str
=
[
k
for
k
in
unused_keys
if
settings_sd
[
k
][
"
Type
"
]
==
"
String
"
]
# Things that no one in the sample has set to a non-default value. Possible candidates for removal.
print
"
\n
Unused_keys_non_str
"
,
len
(
unused_keys_non_str
)
print
"
======================
"
print
"
\n
"
.
join
(
sorted
(
unused_keys_non_str
))
# Strings are not currently logged, so we have no info on usage.
print
"
\n
String keys (usage unknown)
"
,
len
(
unused_keys_str
)
print
"
======================
"
print
"
\n
"
.
join
(
sorted
(
unused_keys
))
print
"
\n
"
.
join
(
sorted
(
unused_keys_str
))
# Things that someone has set but that aren't recognized settings.
unrec_keys
=
list
(
set
(
cnt
.
keys
())
-
set
(
settings_sd
.
keys
()))
print
"
\n
Unrecognized keys
"
,
len
(
unrec_keys
)
print
"
======================
"
print
"
\n
"
.
join
(
sorted
(
unrec_keys
))
def
parse_settings_xml
():
def
parse_settings_xml
(
fname
):
# assume we're in scripts/metrics
fname
=
"
../../indra/newview/app_settings/
settings.xml
"
fname
=
"
../../indra/newview/app_settings/
"
+
fname
with
open
(
fname
,
"
r
"
)
as
f
:
contents
=
f
.
read
()
return
llsd
.
parse_xml
(
contents
)
...
...
@@ -106,11 +117,16 @@ def parse_settings_xml():
show_stats_by_key
(
recs
,[])
show_stats_by_key
(
recs
,[
"
agent
"
])
if
args
.
preferences
:
settings_sd
=
parse_settings_xml
()
print
"
\n
SETTINGS.XML
"
settings_sd
=
parse_settings_xml
(
"
settings.xml
"
)
#for skey,svals in settings_sd.items():
# print skey, "=>", svals
show_stats_by_key
(
recs
,[
"
preferences
"
,
"
settings
"
],
settings_sd
)
print
print
"
\n
SETTINGS_PER_ACCOUNT.XML
"
settings_pa_sd
=
parse_settings_xml
(
"
settings_per_account.xml
"
)
show_stats_by_key
(
recs
,[
"
preferences
"
,
"
settings_per_account
"
],
settings_pa_sd
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment