When viewing a datasource's statistics in ProjectWise Administrator there are 2 dates shown. One is the date/time the database statistics were last updated, the other the date the projectwise statistics were last updated.
If I do a Get-PWStatistics there are 2 stats returned, LAST_UPDATED and LastUpdated
LAST_UPDATED is an integer that works out to be the number of seconds since 1/1/1970. LastUpdated is a date/time. At first I thought one of these was the database statistics and the other projectwise statistics update times but that doesn't seem to be the case.
(Get-Date -Date "1/1/1970 00:00:00").AddSeconds((Get-PWStatistics).LAST_UPDATED) returns the same date/time as LastUpdated (just in UTC time instead of the server time zone)
So my question is - am I correct that LastUpdated is just the date/time representation of LAST_UPDATED (adjusted for local time)?
And if I am correct - is there a way to retrieve the Database Statistics Update date/time? If not, can it be added?
Hey Kevin, I have updated this cmdlet so it will now return the Database (Database statistics last updated). Look for it in a future release of the PWPS_DAB module.
Hey Brian, was this going to be in the 1.5.4.0 just released? I'm not seeing it. output below is from 32-bit PW, i tried 64-bit as well.
[ADMIN][Scripts] >new-pwlogin "HNTB CBS" True [ADMIN][Scripts] >$stat = Get-PWStatistics -IgnoreLastLoginCount [ADMIN][Scripts] >$stat DatasourceName : pw-int.hntb.org:CBS LastUpdated : 5/4/2018 1:00:14 AM TotalFileSize : 95710530241 ACCESSCONTROL_COUNT : 346 AFP_FPROP_DOCS_PROCESSED : 0 AFP_FPROP_DOCS_PROCESSING : 19 AFP_FPROP_DOCS_UNPROCESSED : 0 AFP_FTR_DOCS_PROCESSED : 27069 AFP_FTR_DOCS_PROCESSING : 6 AFP_FTR_DOCS_UNPROCESSED : 6 AFP_THUMB_DOCS_PROCESSED : 27059 AFP_THUMB_DOCS_PROCESSING : 12 AFP_THUMB_DOCS_UNPROCESSED : 0 ATTRIBUTE_COUNT : 332 AUDIT_COUNT : 184325 AVG_ATTRIBUTES_PER_ENV : 30 AVG_AUDIT_RECS_PER_FOLDER : 2 AVG_DOCS_PER_FOLDER : 9 AVG_DOC_FILE_SIZE : 3610350 AVG_FOLDER_DEPTH : 6 AVG_REFERENCE_ATTACHMENTS : 3 AVG_USERS_PER_GROUP : 4 CHKL_REC_COUNT : 1772 DEPARTMENT_COUNT : 7 DOCS_NOT_PROCESSED : 0 DOCS_PROCESSED : 27059 DOCS_PROCESSING : 10 DOCS_WITHOUT_THUMB : 0 DOCS_WITH_FPROPS_COUNT : 6621 DOCS_WITH_THUMB : 12118 DOC_COUNT : 27069 EMPTY_FOLDER_COUNT : 1614 ENVIRONMENT_COUNT : 11 FOLDER_COUNT : 4378 GROUP_COUNT : 17 ITEMS_WITH_AUDIT_RECS : 9015 LAST_UPDATED : 1525413614 MASTERFILE_COUNT : 549 MAX_ATTRIBUTES_PER_ENV : 139 MAX_AUDIT_RECS_PER_FOLDER : 1454 MAX_DOCS_PER_FOLDER : 1253 MAX_DOC_FILE_SIZE : 2001098435 MAX_FOLDER_DEPTH : 15 MAX_REFERENCE_ATTACHMENTS : 25 MAX_USERS_PER_GROUP : 8 MIN_ATTRIBUTES_PER_ENV : 1 MIN_AUDIT_RECS_PER_FOLDER : 0 MIN_DOCS_PER_FOLDER : 1 MIN_DOC_FILE_SIZE : 0 MIN_FOLDER_DEPTH : 1 MIN_REFERENCE_ATTACHMENTS : 1 MIN_USERS_PER_GROUP : 1 ODS_CLASS_COUNT : 40 ORPHANED_THUMB_COUNT : 743 POPULATED_FOLDER_COUNT : 2764 PROJECT_COUNT : 4342 PROPERTY_COUNT : 238 QUERY_COUNT : 23 RICHPROJECT_COUNT : 36 STATE_COUNT : 19 STORAGE_COUNT : 7 THUMB_COUNT : 12861 USER_COUNT : 38 USERS_INACTIVE_07 : 0 USERS_INACTIVE_30 : 0 USERS_INACTIVE_60 : 0 USERS_INACTIVE_90 : 0 USERS_INACTIVE_120 : 0 VIEW_COUNT : 18 WORKFLOW_COUNT : 7 Description : ProjectWiseStatistics Name : ProjectWiseStatistics [ADMIN][Scripts] >Get-VersionReport Powershell 32-bit Name Version ---- ------- PowerShell 5.1.14409.1005 CLR 4.0.30319.42000 IniFunctions 0.0 MenuFunctions 0.0 Microsoft.PowerShell.Management 3.1.0.0 Microsoft.PowerShell.Utility 3.1.0.0 PackageManagement 1.0.0.1 PowerShellGet 1.0.0.1 Pscx 3.3.2 PWPS 0.0.0.6 PWPS_DAB 1.5.4.0 PWPS_KvH 1.0 UsefulFunctions 1.0
Which version of the PWPS_DAB module are you currently running? I just installed the latest (1.5.8.0) and I get the following. Notice DBLastUpdated.DatasourceName : BMF-WS2016:BMF_PWLastUpdated : 4/18/2018 10:00:43 AMDBLastUpdated : 3/21/2018 9:26:36 PMTotalFileSize : 782142451ACCESSCONTROL_COUNT : 129AFP_FPROP_DOCS_PROCESSED : 0AFP_FPROP_DOCS_PROCESSING : 0AFP_FPROP_DOCS_UNPROCESSED : 733AFP_FTR_DOCS_PROCESSED : 0AFP_FTR_DOCS_PROCESSING : 0AFP_FTR_DOCS_UNPROCESSED : 733AFP_THUMB_DOCS_PROCESSED : 0AFP_THUMB_DOCS_PROCESSING : 0AFP_THUMB_DOCS_UNPROCESSED : 733ATTRIBUTE_COUNT : 69AUDIT_COUNT : 8224AVG_ATTRIBUTES_PER_ENV : 23AVG_AUDIT_RECS_PER_FOLDER : 1AVG_DOCS_PER_FOLDER : 4AVG_DOC_FILE_SIZE : 1248422AVG_FOLDER_DEPTH : 3AVG_REFERENCE_ATTACHMENTS : 3AVG_USERS_PER_GROUP : 1CHKL_REC_COUNT : 129DEPARTMENT_COUNT : 0DOCS_NOT_PROCESSED : 733DOCS_PROCESSED : 0DOCS_PROCESSING : 0DOCS_WITHOUT_THUMB : 0DOCS_WITH_FPROPS_COUNT : 0DOCS_WITH_THUMB : 0DOC_COUNT : 733EMPTY_FOLDER_COUNT : 205ENVIRONMENT_COUNT : 3FOLDER_COUNT : 368GROUP_COUNT : 2ITEMS_WITH_AUDIT_RECS : 3435LAST_UPDATED : 1524060043DBLAST_UPDATED : 1521681996MASTERFILE_COUNT : 126MAX_ATTRIBUTES_PER_ENV : 39MAX_AUDIT_RECS_PER_FOLDER : 200MAX_DOCS_PER_FOLDER : 108MAX_DOC_FILE_SIZE : 89722613MAX_FOLDER_DEPTH : 8MAX_REFERENCE_ATTACHMENTS : 18MAX_USERS_PER_GROUP : 1MIN_ATTRIBUTES_PER_ENV : 4MIN_AUDIT_RECS_PER_FOLDER : 0MIN_DOCS_PER_FOLDER : 1MIN_DOC_FILE_SIZE : 193MIN_FOLDER_DEPTH : 1MIN_REFERENCE_ATTACHMENTS : 1MIN_USERS_PER_GROUP : 1ODS_CLASS_COUNT : 38ORPHANED_THUMB_COUNT : 0POPULATED_FOLDER_COUNT : 163PROJECT_COUNT : 356PROPERTY_COUNT : 0QUERY_COUNT : 41RICHPROJECT_COUNT : 12STATE_COUNT : 31STORAGE_COUNT : 1THUMB_COUNT : 0USER_COUNT : 2USERS_INACTIVE_07 : 4USERS_INACTIVE_30 : 4USERS_INACTIVE_60 : 4USERS_INACTIVE_90 : 4USERS_INACTIVE_120 : 4VIEW_COUNT : 2WORKFLOW_COUNT : 4Description : ProjectWiseStatisticsName : ProjectWiseStatistics
I am not seeing the DBLastUpdated field (PWPS_DAB 23.1.3.0) was this removed? Also, gathering statistics is very slow for large datasources. Most of this information is readily available in the database [dbo.dms_statistics]. Could an option be added to only pull the DB information (user inactive info is stored in the DB as well)?
you aren't using the -ForceRefresh option are you? I did a test on a datasource with 3.3 million docs and it took about 23 seconds. Still seems long for a db lookup.
I'm not using that option, if I do, it usually times out before completion. On a similar size datasource with several thousand users, it is taking a couple of hours. The user check is by far the largest portion of time. I am curious how that check works when -ForceRefresh is not used - I would expect it to just read the table info, but it appears to be calculating each time (7, 30, etc.).
Oh, I bet I know why mine is faster (I do see the same issue with -ForceRefresh timing out, i think you're now supposed to use Update-PWStatistics, then wait awhile (an hour?) then go back and read with Get-PWStatistics to get the updated stats)
Anyway, we purge our audit trail of login events over a certain age, and move events > 2 years old to a secondary table so our audit trail table is pretty small.
Same datasource I tested on yesterday:
The USERS_INACTIVE_## stats are probably calculated from the audit trail records. I suspect you have way more audit trail records (or at least way more login records) than we do.
In fact I was just thinking, "I think this came up before" and I double checked Get-PWStatistics and they added an option -IgnoreLastLoginCount
WHen I use that option my get-pwstatistics went from 15 seconds to 3.