コード例 #1
0
        public Dashboard getProfile()
        {
            Dashboard dProfile = new Dashboard(0, 0, 0, new List<string>(), new List<string>());
            try
            {
                IEnumerator<Dashboard> results = dashboardTable.ExecuteQuery(new TableQuery<Dashboard>()).GetEnumerator();
                if (results.MoveNext())
                {
                    Dashboard result = results.Current;
                    dProfile.numUrlsCrawled = result.numUrlsCrawled;
                    dProfile.numUrlsIndexed = result.numUrlsIndexed;
                }

                foreach (PageInfo webinfo in pageTable.ExecuteQuery((new TableQuery<PageInfo>()).Take(10)))
                {
                    dProfile.urlsCrawled.Add(webinfo.url);
                }

                foreach (ErrorUrl crawlError in errorTable.ExecuteQuery((new TableQuery<ErrorUrl>()).Take(100)))
                {
                    dProfile.crawlErrors.Add(crawlError.message + ": " + crawlError.url);
                }

                urlQ.FetchAttributes();
                dProfile.numUrlsQueued = urlQ.ApproximateMessageCount.GetValueOrDefault(0);
            }
            catch (StorageException) {  }
            return dProfile;
        }
コード例 #2
0
 public void clear()
 {
     Dashboard dInfo = new Dashboard(0, 0, 0, new List<string>(), new List<string>());
     dInfo.ETag = "*";
     dashboardTable.Execute(TableOperation.Replace(dInfo));
 }