Get Analysis Services last processed date

Topic(s)
Audience

Everyone

I need a little bit of code to get the last processed date for the cube that my site connects to:

Public Function GetCubeLastProcessedDates(ByVal AnalysisServer As String) As Collection(Of CubeInfo)
    Dim result As Collection(Of CubeInfo)
    Dim identity As WindowsIdentity = WindowsIdentity.GetCurrent()
    Dim eCode As Integer = CommonUtility.RevertToSelf()
    Dim oServer As New Server
    Try
        result = New Collection(Of CubeInfo)
        oServer.Connect(String.Format(CultureInfo.InvariantCulture, "data Source = {0};", AnalysisServer))

        For Each d As Database In oServer.Databases
            For Each c As Cube In d.Cubes
                result.Add(New CubeInfo(d.Name, c.Name, c.LastProcessed))
            Next
        Next

        oServer.Disconnect()
    Catch e As ConnectionException
        ' Do some error handling
    Catch e As AdomdErrorResponseException
        ' Do some error handling
    Catch e As AdomdConnectionException
        ' Do some error handling
    Catch e As Microsoft.AnalysisServices.AmoException
        ' Do some error handling
    Catch e As Exception
        Throw
    Finally
        oServer.Dispose()
        identity.Impersonate()
    End Try
    '------------------------------
    Return result
End Function

 

The only problem I have with this is that while it takes no longer than 5 seconds to return a negative result, it can take as much as 30 seconds to return when in the positive (i.e. you can access the cube).

This makes it a threading only, and more than that, a nice to have only. If this is critical information then you will just have to wait…

Technorati Tags:  

Create a conversation around this article

Share on Facebook
Share on Twitter
Share on Linkdin

Read more

Martin Hinshelwood
In organizational development and team dynamics, Agile (as the Agile Manifesto delineates) and Scrum (as the Scrum Guide outlines) guide teams not by solving their problems but by illuminating the issues that demand attention. These frameworks aim to identify and spotlight the challenges within a team or organization’s processes, effectively …
Martin Hinshelwood
This week, I participated in a Scrum.org Webinar hosted by Sabrina Love (Scrum.org Product Owner) as well as my colleagues, Joanna Płaskonka, Ph.D. and Alex Ballarin to discuss the state of learning and how immersive learning is the future of training. You can watch the video below to hear what …
Martin Hinshelwood
For a long time now I have been searching for that perfect domain that epitomised the vision, the why, of what I am trying to achieve with my customers and the industry at large. Now I have found it in http://nkdagility.com
Martin Hinshelwood
At the MVP Summit I was appalled by the number of people who asked questions about new features for supporting hierarchical tasks! I shared a disgusted look with Peter Provost and we had a quick (and I mean really quick) conversation that resulted in this post. it really comes down …